Update search page and emptyNotice

This commit is contained in:
Prayag Prajapati committed 2023-12-29 11:00:06 +05:30
1 parent bccc19981e
commit afcc8cfd4d
2 files changed
+38 -6

No files matched your search

@@ -5,7 +5,7 @@ import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography"; import Typography from "@mui/material/Typography";
import { yellow } from "@mui/material/colors"; import { yellow } from "@mui/material/colors";
export const EmptyNotice = () => { export const EmptyNotice = ({ extraMsg }) => {
return ( return (
<Box <Box
sx={{ sx={{
@@ -19,20 +19,26 @@ export const EmptyNotice = () => {
}} }}
> >
<div <div
className="material-symbols-rounded animate-icon" className="material-symbols-rounded"
style={{ style={{
fontSize: "10em", fontSize: "10em",
color: yellow[800], color: yellow[800],
fontVariationSettings: fontVariationSettings:
'"FILL" 0, "wght" 100, "GRAD" 25, "opsz" 40', '"FILL" 1, "wght" 400, "GRAD" 25, "opsz" 60',
"--clr": "rgb(249 168 37 / 30%)",
}} }}
> >
sentiment_dissatisfied sentiment_dissatisfied
</div> </div>
<Typography variant="h3" fontWeight={100}> <Typography variant="h4" fontWeight={300}>
No results found No results found
</Typography> </Typography>
<Typography
variant="subtitle1"
fontWeight={300}
style={{ opacity: 0.5 }}
>
{extraMsg}
</Typography>
</Box> </Box>
); );
}; };
+27 -1
View File
@@ -12,7 +12,7 @@ import { MdiMagnify } from "../../components/icons/mdiMagnify";
import { useQuery } from "@tanstack/react-query"; import { useQuery } from "@tanstack/react-query";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api"; import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
import { getSearchApi } from "@jellyfin/sdk/lib/utils/api/search-api"; import { EmptyNotice } from "../../components/notices/emptyNotice/emptyNotice";
import useDebounce from "../../utils/hooks/useDebounce"; import useDebounce from "../../utils/hooks/useDebounce";
@@ -179,6 +179,7 @@ const SearchPage = () => {
style: { style: {
border: "100px !important", border: "100px !important",
}, },
autoFocus: true,
startAdornment: ( startAdornment: (
<InputAdornment position="start"> <InputAdornment position="start">
<div <div
@@ -479,6 +480,31 @@ const SearchPage = () => {
</CardScroller> </CardScroller>
)} )}
</div> </div>
{movies.isSuccess &&
series.isSuccess &&
audio.isSuccess &&
musicAlbum.isSuccess &&
book.isSuccess &&
musicArtists.isSuccess &&
person.isSuccess &&
movies.data.Items.length == 0 &&
series.data.Items.length == 0 &&
audio.data.Items.length == 0 &&
musicAlbum.data.Items.length == 0 &&
book.data.Items.length == 0 &&
musicArtists.data.Items.length == 0 &&
person.data.Items.length == 0 && (
<div
style={{
height: "calc(100vh - 12em)",
}}
>
<EmptyNotice
extraMsg={"Try using different terms."}
/>
</div>
)}
</div> </div>
); );
}; };