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