Fix 0 is not a fn in titlePage
This commit is contained in:
5 files changed
+62
-16
No files matched your search
Generated
+12
@@ -27,6 +27,7 @@
|
|||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-blurhash": "^0.3.0",
|
"react-blurhash": "^0.3.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
|
"react-error-boundary": "^4.0.10",
|
||||||
"react-konami-code": "^2.3.0",
|
"react-konami-code": "^2.3.0",
|
||||||
"react-material-ui-carousel": "^3.4.2",
|
"react-material-ui-carousel": "^3.4.2",
|
||||||
"react-multi-carousel": "^2.8.3",
|
"react-multi-carousel": "^2.8.3",
|
||||||
@@ -2789,6 +2790,17 @@
|
|||||||
"react": "^18.2.0"
|
"react": "^18.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/react-error-boundary": {
|
||||||
|
"version": "4.0.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-4.0.10.tgz",
|
||||||
|
"integrity": "sha512-pvVKdi77j2OoPHo+p3rorgE43OjDWiqFkaqkJz8sJKK6uf/u8xtzuaVfj5qJ2JnDLIgF1De3zY5AJDijp+LVPA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/runtime": "^7.12.5"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": ">=16.13.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/react-fast-compare": {
|
"node_modules/react-fast-compare": {
|
||||||
"version": "3.2.2",
|
"version": "3.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/react-fast-compare/-/react-fast-compare-3.2.2.tgz",
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-blurhash": "^0.3.0",
|
"react-blurhash": "^0.3.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
|
"react-error-boundary": "^4.0.10",
|
||||||
"react-konami-code": "^2.3.0",
|
"react-konami-code": "^2.3.0",
|
||||||
"react-material-ui-carousel": "^3.4.2",
|
"react-material-ui-carousel": "^3.4.2",
|
||||||
"react-multi-carousel": "^2.8.3",
|
"react-multi-carousel": "^2.8.3",
|
||||||
|
|||||||
@@ -397,6 +397,7 @@ function App() {
|
|||||||
</Routes>
|
</Routes>
|
||||||
</div>
|
</div>
|
||||||
</AnimatePresence>
|
</AnimatePresence>
|
||||||
|
<ReactQueryDevtools />
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
</SnackbarProvider>
|
</SnackbarProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
+34
-10
@@ -49,6 +49,8 @@ import { useNavigate } from "react-router-dom";
|
|||||||
import { endsAt, getRuntime } from "../../utils/date/time";
|
import { endsAt, getRuntime } from "../../utils/date/time";
|
||||||
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
import { BaseItemKind, ItemFields } from "@jellyfin/sdk/lib/generated-client";
|
||||||
|
|
||||||
|
import { ErrorBoundary } from "react-error-boundary";
|
||||||
|
|
||||||
const Home = () => {
|
const Home = () => {
|
||||||
const authUser = useQuery({
|
const authUser = useQuery({
|
||||||
queryKey: ["home", "authenticateUser"],
|
queryKey: ["home", "authenticateUser"],
|
||||||
@@ -249,12 +251,24 @@ const Home = () => {
|
|||||||
latestMedia.data.length != 0 &&
|
latestMedia.data.length != 0 &&
|
||||||
latestMedia.data.map((item, index) => {
|
latestMedia.data.map((item, index) => {
|
||||||
return (
|
return (
|
||||||
|
<ErrorBoundary
|
||||||
|
fallback={
|
||||||
|
<div>
|
||||||
|
Something went wrong in
|
||||||
|
carousel slide for
|
||||||
|
{" --- "}
|
||||||
|
{item.Name}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
<Paper
|
<Paper
|
||||||
className="hero-carousel-slide"
|
className="hero-carousel-slide"
|
||||||
sx={{
|
sx={{
|
||||||
background:
|
background:
|
||||||
theme.palette.primary
|
theme.palette
|
||||||
.background.dark,
|
.primary
|
||||||
|
.background
|
||||||
|
.dark,
|
||||||
}}
|
}}
|
||||||
key={index}
|
key={index}
|
||||||
>
|
>
|
||||||
@@ -282,7 +296,9 @@ const Home = () => {
|
|||||||
96
|
96
|
||||||
}
|
}
|
||||||
className="hero-carousel-background-blurhash"
|
className="hero-carousel-background-blurhash"
|
||||||
punch={1}
|
punch={
|
||||||
|
1
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
className="hero-carousel-background-image"
|
className="hero-carousel-background-image"
|
||||||
@@ -305,7 +321,7 @@ const Home = () => {
|
|||||||
.ImageBlurHashes
|
.ImageBlurHashes
|
||||||
.Backdrop[
|
.Backdrop[
|
||||||
item
|
item
|
||||||
.BackdropImageTags[0]
|
.BackdropImageTags[2]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
|
// hash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
|
||||||
@@ -318,7 +334,9 @@ const Home = () => {
|
|||||||
96
|
96
|
||||||
}
|
}
|
||||||
className="hero-carousel-background-blurhash"
|
className="hero-carousel-background-blurhash"
|
||||||
punch={1}
|
punch={
|
||||||
|
1
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<div
|
<div
|
||||||
@@ -354,13 +372,15 @@ const Home = () => {
|
|||||||
mb: 2.5,
|
mb: 2.5,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{!item.ImageTags.Logo ? (
|
{!item.ImageTags
|
||||||
|
.Logo ? (
|
||||||
item.Name
|
item.Name
|
||||||
) : (
|
) : (
|
||||||
<img
|
<img
|
||||||
className="hero-carousel-text-logo"
|
className="hero-carousel-text-logo"
|
||||||
src={
|
src={
|
||||||
window.api
|
window
|
||||||
|
.api
|
||||||
.basePath +
|
.basePath +
|
||||||
"/Items/" +
|
"/Items/" +
|
||||||
item.Id +
|
item.Id +
|
||||||
@@ -461,11 +481,14 @@ const Home = () => {
|
|||||||
className="hero-carousel-text"
|
className="hero-carousel-text"
|
||||||
sx={{
|
sx={{
|
||||||
display: "-webkit-box",
|
display: "-webkit-box",
|
||||||
maxWidth: "70%",
|
maxWidth:
|
||||||
maxHeight: "30%",
|
"70%",
|
||||||
|
maxHeight:
|
||||||
|
"30%",
|
||||||
textOverflow:
|
textOverflow:
|
||||||
"ellipsis",
|
"ellipsis",
|
||||||
overflow: "hidden",
|
overflow:
|
||||||
|
"hidden",
|
||||||
WebkitLineClamp:
|
WebkitLineClamp:
|
||||||
"3",
|
"3",
|
||||||
WebkitBoxOrient:
|
WebkitBoxOrient:
|
||||||
@@ -510,6 +533,7 @@ const Home = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
</ErrorBoundary>
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -767,14 +767,21 @@ const ItemDetail = () => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!!item.data.ImageBlurHashes
|
{!!item.data.ImageTags.Primary &&
|
||||||
.Primary && (
|
Object.keys(
|
||||||
|
item.data.ImageBlurHashes
|
||||||
|
.Primary,
|
||||||
|
).length != 0 && (
|
||||||
<Blurhash
|
<Blurhash
|
||||||
hash={
|
hash={
|
||||||
item.data.ImageBlurHashes
|
item.data
|
||||||
|
.ImageBlurHashes
|
||||||
.Primary[
|
.Primary[
|
||||||
item.data.ImageTags
|
Object.keys(
|
||||||
.Primary
|
item.data
|
||||||
|
.ImageBlurHashes
|
||||||
|
.Primary,
|
||||||
|
)[0]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
width="100%"
|
width="100%"
|
||||||
@@ -785,7 +792,8 @@ const ItemDetail = () => {
|
|||||||
aspectRatio: `${
|
aspectRatio: `${
|
||||||
!!item.data
|
!!item.data
|
||||||
.PrimaryImageAspectRatio
|
.PrimaryImageAspectRatio
|
||||||
? item.data
|
? item
|
||||||
|
.data
|
||||||
.PrimaryImageAspectRatio
|
.PrimaryImageAspectRatio
|
||||||
: 1
|
: 1
|
||||||
}`,
|
}`,
|
||||||
|
|||||||
Reference in new issue
Block a user