Update search page and emptyNotice
This commit is contained in:
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 { yellow } from "@mui/material/colors";
|
||||
|
||||
export const EmptyNotice = () => {
|
||||
export const EmptyNotice = ({ extraMsg }) => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
@@ -19,20 +19,26 @@ export const EmptyNotice = () => {
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="material-symbols-rounded animate-icon"
|
||||
className="material-symbols-rounded"
|
||||
style={{
|
||||
fontSize: "10em",
|
||||
color: yellow[800],
|
||||
fontVariationSettings:
|
||||
'"FILL" 0, "wght" 100, "GRAD" 25, "opsz" 40',
|
||||
"--clr": "rgb(249 168 37 / 30%)",
|
||||
'"FILL" 1, "wght" 400, "GRAD" 25, "opsz" 60',
|
||||
}}
|
||||
>
|
||||
sentiment_dissatisfied
|
||||
</div>
|
||||
<Typography variant="h3" fontWeight={100}>
|
||||
<Typography variant="h4" fontWeight={300}>
|
||||
No results found
|
||||
</Typography>
|
||||
<Typography
|
||||
variant="subtitle1"
|
||||
fontWeight={300}
|
||||
style={{ opacity: 0.5 }}
|
||||
>
|
||||
{extraMsg}
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -12,7 +12,7 @@ import { MdiMagnify } from "../../components/icons/mdiMagnify";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
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";
|
||||
|
||||
@@ -179,6 +179,7 @@ const SearchPage = () => {
|
||||
style: {
|
||||
border: "100px !important",
|
||||
},
|
||||
autoFocus: true,
|
||||
startAdornment: (
|
||||
<InputAdornment position="start">
|
||||
<div
|
||||
@@ -479,6 +480,31 @@ const SearchPage = () => {
|
||||
</CardScroller>
|
||||
)}
|
||||
</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>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user