20 files changed
+389
-148
No files matched your search
@@ -271,6 +271,7 @@ function App() {
|
||||
console.log("WindowAPi not present");
|
||||
serverAvailable().then((available) => {
|
||||
if (available) {
|
||||
console.log(available);
|
||||
createApi().then(
|
||||
userSaved().then((userSavedBool) => {
|
||||
if (userSavedBool) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** @format */
|
||||
import { useEffect } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import MuiAppBar from "@mui/material/AppBar";
|
||||
import TextField from "@mui/material/TextField";
|
||||
@@ -28,7 +28,7 @@ export const AppBar = () => {
|
||||
const dispatch = useDispatch();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const visible = useSelector((state) => state.appBar.visible);
|
||||
const [display, setDisplay] = useState(false);
|
||||
const backButtonVisible = useSelector(
|
||||
(state) => state.appBar.backButtonVisible,
|
||||
);
|
||||
@@ -42,7 +42,7 @@ export const AppBar = () => {
|
||||
let usr = await getUserApi(window.api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
enabled: visible,
|
||||
enabled: display,
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
@@ -51,14 +51,28 @@ export const AppBar = () => {
|
||||
threshold: 0,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
location.pathname.includes("login") ||
|
||||
location.pathname.includes("setup")
|
||||
) {
|
||||
setDisplay(false);
|
||||
} else {
|
||||
setDisplay(true);
|
||||
}
|
||||
}, [location]);
|
||||
|
||||
useEffect(() => {
|
||||
if (location.pathname == "/home") {
|
||||
dispatch(hideBackButton());
|
||||
}
|
||||
});
|
||||
}, [location]);
|
||||
|
||||
return (
|
||||
visible && (
|
||||
if (!display) {
|
||||
return <></>;
|
||||
}
|
||||
if (display) {
|
||||
return (
|
||||
<MuiAppBar
|
||||
sx={{
|
||||
width: `calc(100vw - ${theme.spacing(7)})`,
|
||||
@@ -130,6 +144,6 @@ export const AppBar = () => {
|
||||
</Box>
|
||||
</Toolbar>
|
||||
</MuiAppBar>
|
||||
)
|
||||
);
|
||||
);
|
||||
}
|
||||
};
|
||||
@@ -1,6 +1,7 @@
|
||||
/** @format */
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import ButtonBase from "@mui/material/ButtonBase";
|
||||
|
||||
@@ -10,7 +11,7 @@ import "./avatar.module.scss";
|
||||
|
||||
export const AvatarImage = ({ userId, userImageTags }) => {
|
||||
return (
|
||||
<div className="avatar-image-container">
|
||||
<Box className="avatar-image-container">
|
||||
{!!userImageTags && (
|
||||
<div
|
||||
className="avatar-image"
|
||||
@@ -28,7 +29,7 @@ export const AvatarImage = ({ userId, userImageTags }) => {
|
||||
<div className="avatar-image-icon-container">
|
||||
<MdiAccount className="avatar-image-icon" />
|
||||
</div>
|
||||
</div>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
&-icon {
|
||||
height: 100%;
|
||||
padding: 0.2em;
|
||||
background: $clr-accent-dark;
|
||||
color: $clr-accent-default;
|
||||
font-size: 2em !important;
|
||||
background: $clr-gradient-dark;
|
||||
fill: url(#clr-gradient-default) !important;
|
||||
font-size: 7em !important;
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,7 @@ export const EpisodeCard = ({
|
||||
favourite,
|
||||
showName,
|
||||
episodeLocation,
|
||||
centerAlignText = false,
|
||||
}) => {
|
||||
const navigate = useNavigate();
|
||||
const [imgLoading, setImgLoading] = useState(true);
|
||||
@@ -270,29 +271,33 @@ export const EpisodeCard = ({
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={500}
|
||||
textAlign="left"
|
||||
textAlign={
|
||||
centerAlignText ? "center" : "left"
|
||||
}
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
>
|
||||
{itemName}
|
||||
</Typography>
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="h6"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={300}
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
sx={{
|
||||
opacity: 0.65,
|
||||
}}
|
||||
>
|
||||
{getRuntime(itemTicks)}
|
||||
</Typography>
|
||||
{!!itemTicks && (
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="h6"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={300}
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
sx={{
|
||||
opacity: 0.65,
|
||||
}}
|
||||
>
|
||||
{getRuntime(itemTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
</Box>
|
||||
<Stack
|
||||
alignItems="flex-start"
|
||||
@@ -308,47 +313,54 @@ export const EpisodeCard = ({
|
||||
}
|
||||
mb={1}
|
||||
>
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="subtitle1"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={300}
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
sx={{
|
||||
opacity: 0.65,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-start",
|
||||
}}
|
||||
>
|
||||
<MdiStarHalfFull
|
||||
sx={{ fontSize: "1.2em", mr: "0.25em" }}
|
||||
/>{" "}
|
||||
{itemRating}
|
||||
</Typography>
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="subtitle1"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={300}
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
sx={{
|
||||
opacity: 0.65,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-start",
|
||||
}}
|
||||
>
|
||||
{endsAt(itemTicks)}
|
||||
</Typography>
|
||||
{!!itemRating && (
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="subtitle1"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={300}
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
sx={{
|
||||
opacity: 0.65,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-start",
|
||||
}}
|
||||
>
|
||||
<MdiStarHalfFull
|
||||
sx={{
|
||||
fontSize: "1.2em",
|
||||
mr: "0.25em",
|
||||
}}
|
||||
/>{" "}
|
||||
{itemRating}
|
||||
</Typography>
|
||||
)}
|
||||
{!!itemTicks && (
|
||||
<Typography
|
||||
gutterBottom={false}
|
||||
variant="subtitle1"
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={300}
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
sx={{
|
||||
opacity: 0.65,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "flex-start",
|
||||
}}
|
||||
>
|
||||
{endsAt(itemTicks)}
|
||||
</Typography>
|
||||
)}
|
||||
</Stack>
|
||||
<Typography
|
||||
gutterBottom
|
||||
@@ -387,6 +399,7 @@ EpisodeCard.propTypes = {
|
||||
favourite: PropTypes.bool,
|
||||
showName: PropTypes.string,
|
||||
episodeLocation: PropTypes.string,
|
||||
itemTicks: PropTypes.number.isRequired,
|
||||
itemRating: PropTypes.number.isRequired,
|
||||
itemTicks: PropTypes.number,
|
||||
itemRating: PropTypes.number,
|
||||
centerAlignText: PropTypes.bool,
|
||||
};
|
||||
@@ -21,6 +21,7 @@ export const CardScroller = ({
|
||||
displayCards,
|
||||
title,
|
||||
headingProps,
|
||||
disableDecoration = false,
|
||||
}) => {
|
||||
const responsive = {
|
||||
superLargeDesktop: {
|
||||
@@ -50,7 +51,14 @@ export const CardScroller = ({
|
||||
|
||||
return (
|
||||
<Box className="card-scroller-container" sx={{ mb: 4 }}>
|
||||
<Box sx={{ mb: 2 }} className="card-scroller-header-container">
|
||||
<Box
|
||||
sx={{ mb: 2 }}
|
||||
className={
|
||||
disableDecoration
|
||||
? `card-scroller-header-container hidden-decoration`
|
||||
: `card-scroller-header-container`
|
||||
}
|
||||
>
|
||||
<Typography
|
||||
variant="h4"
|
||||
color="textPrimary"
|
||||
|
||||
@@ -29,3 +29,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hidden-decoration {
|
||||
.card-scroller-heading-decoration {
|
||||
display: hidden;
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||
let usr = await getUserApi(window.api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
networkMode: "always",
|
||||
});
|
||||
const fetchLatestMedia = async (library) => {
|
||||
const media = await getUserLibraryApi(window.api).getLatestMedia({
|
||||
@@ -29,6 +30,7 @@ export const LatestMediaSection = ({ latestMediaLib }) => {
|
||||
queryKey: ["homeSection, latestMedia", latestMediaLib],
|
||||
queryFn: () => fetchLatestMedia(latestMediaLib[0]),
|
||||
enabled: !!user.data,
|
||||
networkMode: "always",
|
||||
});
|
||||
if (data.isLoading) {
|
||||
return <CardsSkeleton />;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiAlertDecagram } from "@mdi/js";
|
||||
|
||||
export const MdiAlertDecagram = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiAlertDecagram}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiEmoticonCry } from "@mdi/js";
|
||||
|
||||
export const MdiEmoticonCry = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEmoticonCry}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @format */
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiEmoticonDead } from "@mdi/js";
|
||||
|
||||
export const MdiEmoticonDead = (props) => {
|
||||
return (
|
||||
<SvgIcon {...props}>
|
||||
<path d={mdiEmoticonDead}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -62,7 +62,6 @@ export const SideMenu = ({}) => {
|
||||
|
||||
const [display, setDisplay] = useState(false);
|
||||
|
||||
const visible = useSelector((state) => state.sidebar.visible);
|
||||
const backdrop = useSelector((state) => state.sidebar.backdrop);
|
||||
const navigate = useNavigate();
|
||||
const user = useQuery({
|
||||
@@ -96,15 +95,18 @@ export const SideMenu = ({}) => {
|
||||
navigate("/login");
|
||||
};
|
||||
|
||||
const getCurrentPathWithoutParam = () => {
|
||||
const getCurrentLocation = () => {
|
||||
return location.pathname.slice(0, location.pathname.lastIndexOf("/"));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
console.log(location.pathname.includes("login"));
|
||||
if (
|
||||
getCurrentPathWithoutParam() != "/login" &&
|
||||
getCurrentPathWithoutParam() != "/setup/server"
|
||||
location.pathname.includes("login") ||
|
||||
location.pathname.includes("setup")
|
||||
) {
|
||||
setDisplay(false);
|
||||
} else {
|
||||
setDisplay(true);
|
||||
}
|
||||
}, [location]);
|
||||
@@ -122,17 +124,13 @@ export const SideMenu = ({}) => {
|
||||
sx: {
|
||||
backgroundColor: "inherit",
|
||||
border: "none",
|
||||
width: visible
|
||||
? `calc(${theme.spacing(7)} + 10px)`
|
||||
: 0,
|
||||
width: `calc(${theme.spacing(7)} + 10px)`,
|
||||
height: "100vh",
|
||||
// display: visible ? "block" : "none",
|
||||
},
|
||||
}}
|
||||
sx={{
|
||||
width: visible
|
||||
? `calc(${theme.spacing(7)} + 10px)`
|
||||
: 0,
|
||||
width: `calc(${theme.spacing(7)} + 10px)`,
|
||||
background: backdrop
|
||||
? theme.palette.background.paper
|
||||
: "transparent",
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
/** @format */
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import { MdiEmoticonCryOutline } from "../icons/mdiEmoticonCryOutline";
|
||||
import { MdiEmoticonCry } from "../../icons/mdiEmoticonCry";
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
export const EmptyNotice = () => {
|
||||
@@ -17,7 +17,7 @@ export const EmptyNotice = () => {
|
||||
opacity: 0.2,
|
||||
}}
|
||||
>
|
||||
<MdiEmoticonCryOutline sx={{ fontSize: 200 }} />
|
||||
<MdiEmoticonCry sx={{ fontSize: 200 }} />
|
||||
<Typography variant="h3">Nothing found</Typography>
|
||||
</Box>
|
||||
);
|
||||
@@ -0,0 +1,24 @@
|
||||
/** @format */
|
||||
|
||||
import Box from "@mui/material/Box";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import { MdiEmoticonDead } from "../../icons/mdiEmoticonDead";
|
||||
|
||||
export const ErrorNotice = () => {
|
||||
return (
|
||||
<Box
|
||||
sx={{
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
flexFlow: "column",
|
||||
opacity: 0.2,
|
||||
}}
|
||||
>
|
||||
<MdiEmoticonDead sx={{ fontSize: 200 }} />
|
||||
<Typography variant="h3">Something went wrong</Typography>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -101,4 +101,5 @@ export const TypeIconCollectionCard = {
|
||||
UserView: <MdiMultimedia className="card-image-icon" />,
|
||||
Video: <MdiFilmstrip className="card-image-icon" />,
|
||||
Year: <MdiMultimedia className="card-image-icon" />,
|
||||
Genre: <MdiDramaMasks className="card-image-icon" />,
|
||||
};
|
||||
@@ -67,6 +67,10 @@
|
||||
}
|
||||
}
|
||||
&-title-logo {
|
||||
filter: drop-shadow(0 0 10px rgb(0 0 0 /0.2));
|
||||
max-width: 75%;
|
||||
height: 2em;
|
||||
object-fit: contain;
|
||||
object-position: bottom;
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,7 @@ import { MdiCheck } from "../../components/icons/mdiCheck";
|
||||
import { MdiHeartOutline } from "../../components/icons/mdiHeartOutline";
|
||||
import { MdiHeart } from "../../components/icons/mdiHeart";
|
||||
import { EpisodeCardsSkeleton } from "../../components/skeleton/episodeCards";
|
||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||
function TabPanel(props) {
|
||||
const { children, value, index, ...other } = props;
|
||||
|
||||
@@ -165,6 +166,22 @@ const ItemDetail = () => {
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const nextUpEpisode = useQuery({
|
||||
queryKey: ["item", "seasons", id, "nextUp"],
|
||||
queryFn: async () => {
|
||||
const result = await getTvShowsApi(window.api).getNextUp({
|
||||
userId: user.data.Id,
|
||||
limit: 1,
|
||||
parentId: item.data.Id,
|
||||
disableFirstEpisode: true,
|
||||
});
|
||||
return result.data;
|
||||
},
|
||||
enabled: item.isSuccess && item.data.Type == "Series",
|
||||
networkMode: "always",
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
const [currentSeason, setCurrentSeason] = useState(0);
|
||||
const episodes = useQuery({
|
||||
queryKey: ["item", "episode", `season ${currentSeason + 1}`],
|
||||
@@ -311,7 +328,8 @@ const ItemDetail = () => {
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
);
|
||||
} else if (item.isSuccess && similarItems.isSuccess) {
|
||||
}
|
||||
if (item.isSuccess && similarItems.isSuccess) {
|
||||
return (
|
||||
<>
|
||||
<Box className="item-detail-backdrop">
|
||||
@@ -477,9 +495,9 @@ const ItemDetail = () => {
|
||||
>
|
||||
<Typography
|
||||
variant="h3"
|
||||
sx={{ width: "30%" }}
|
||||
textOverflow="ellipsis"
|
||||
whiteSpace="nowrap"
|
||||
width="100%"
|
||||
>
|
||||
{!!item.data.ImageTags
|
||||
.Logo ? (
|
||||
@@ -710,6 +728,77 @@ const ItemDetail = () => {
|
||||
</Typography>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{nextUpEpisode.isSuccess && (
|
||||
<Grid2
|
||||
container
|
||||
columns={{
|
||||
xs: 2,
|
||||
sm: 3,
|
||||
md: 4,
|
||||
}}
|
||||
>
|
||||
{nextUpEpisode.data.Items.map(
|
||||
(mitem, mindex) => {
|
||||
return (
|
||||
<Grid2
|
||||
key={mindex}
|
||||
xs={1}
|
||||
sm={1}
|
||||
md={1}
|
||||
>
|
||||
<EpisodeCard
|
||||
itemId={mitem.Id}
|
||||
itemName={`${mitem.IndexNumber}. ${mitem.Name}`}
|
||||
imageTags={
|
||||
!!mitem
|
||||
.ImageTags
|
||||
.Primary
|
||||
}
|
||||
playedPercent={
|
||||
mitem.UserData
|
||||
.PlayedPercentage
|
||||
}
|
||||
watchedStatus={
|
||||
mitem.UserData
|
||||
.Played
|
||||
}
|
||||
favourite={
|
||||
mitem.UserData
|
||||
.IsFavorite
|
||||
}
|
||||
blurhash={
|
||||
mitem.ImageBlurHashes ==
|
||||
{}
|
||||
? ""
|
||||
: !!mitem
|
||||
.ImageTags
|
||||
.Primary
|
||||
? !!mitem
|
||||
.ImageBlurHashes
|
||||
.Primary
|
||||
? mitem
|
||||
.ImageBlurHashes
|
||||
.Primary[
|
||||
mitem
|
||||
.ImageTags
|
||||
.Primary
|
||||
]
|
||||
: ""
|
||||
: ""
|
||||
}
|
||||
currentUser={
|
||||
user.data
|
||||
}
|
||||
centerAlignText
|
||||
/>
|
||||
</Grid2>
|
||||
);
|
||||
},
|
||||
)}
|
||||
</Grid2>
|
||||
)}
|
||||
|
||||
{seasons.isSuccess && (
|
||||
<Box>
|
||||
<Tabs
|
||||
@@ -1609,8 +1698,9 @@ const ItemDetail = () => {
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
} else if (item.isError || similarItems.isError) {
|
||||
return <h1>{"Something went wrong :("}</h1>;
|
||||
}
|
||||
if (item.isError || similarItems.isError) {
|
||||
return <ErrorNotice />;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ import { getStudiosApi } from "@jellyfin/sdk/lib/utils/api/studios-api";
|
||||
import { getPersonsApi } from "@jellyfin/sdk/lib/utils/api/persons-api";
|
||||
|
||||
import { Card } from "../../components/card/card";
|
||||
import { EmptyNotice } from "../../components/emptyNotice/emptyNotice";
|
||||
import { EmptyNotice } from "../../components/notices/emptyNotice/emptyNotice";
|
||||
|
||||
import { MdiSortDescending } from "../../components/icons/mdiSortDescending";
|
||||
import { MdiSortAscending } from "../../components/icons/mdiSortAscending";
|
||||
@@ -44,6 +44,7 @@ import { MdiChevronDown } from "../../components/icons/mdiChevronDown";
|
||||
import { MdiFilterOutline } from "../../components/icons/mdiFilterOutline";
|
||||
|
||||
import { clrBackgroundDarkOpacity0_8 } from "../../palette.module.scss";
|
||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice";
|
||||
|
||||
const LibraryView = () => {
|
||||
const navigate = useNavigate();
|
||||
@@ -365,7 +366,7 @@ const LibraryView = () => {
|
||||
sx={{
|
||||
width: `calc(100vw - ${theme.spacing(7)})`,
|
||||
mt: 8,
|
||||
backdropFilter: `blur(30px)`,
|
||||
backdropFilter: trigger ? `blur(30px)` : "none",
|
||||
background: "transparent",
|
||||
backgroundColor: trigger
|
||||
? `${clrBackgroundDarkOpacity0_8} !important`
|
||||
@@ -850,6 +851,7 @@ const LibraryView = () => {
|
||||
})}
|
||||
</Grid2>
|
||||
))}
|
||||
{items.isError && <ErrorNotice />}
|
||||
</Box>
|
||||
</Box>
|
||||
);
|
||||
|
||||
+91
-56
@@ -17,7 +17,7 @@ import { MdiEyeOutline } from "../../components/icons/mdiEyeOutline";
|
||||
import { MdiChevronRight } from "../../components/icons/mdiChevronRight";
|
||||
|
||||
import Container from "@mui/material/Container";
|
||||
import Grid from "@mui/material/Grid";
|
||||
import Grid from "@mui/material/Unstable_Grid2";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import OutlinedInput from "@mui/material/OutlinedInput";
|
||||
import FormControl from "@mui/material/FormControl";
|
||||
@@ -27,6 +27,7 @@ import IconButton from "@mui/material/IconButton";
|
||||
import LoadingButton from "@mui/lab/LoadingButton";
|
||||
import Button from "@mui/material/Button";
|
||||
import Box from "@mui/material/Box";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import LinearProgress from "@mui/material/LinearProgress";
|
||||
import { useSnackbar } from "notistack";
|
||||
import FormGroup from "@mui/material/FormGroup";
|
||||
@@ -45,6 +46,7 @@ import { getBrandingApi } from "@jellyfin/sdk/lib/utils/api/branding-api";
|
||||
|
||||
import "./login.module.scss";
|
||||
import { CardsSkeleton } from "../../components/skeleton/cards.jsx";
|
||||
import { ErrorNotice } from "../../components/notices/errorNotice/errorNotice.jsx";
|
||||
|
||||
export const LoginWithImage = () => {
|
||||
const dispatch = useDispatch();
|
||||
@@ -123,6 +125,7 @@ export const LoginWithImage = () => {
|
||||
justifyContent="center"
|
||||
alignItems="center"
|
||||
spacing={2}
|
||||
width="100%"
|
||||
>
|
||||
<Grid
|
||||
container
|
||||
@@ -135,9 +138,9 @@ export const LoginWithImage = () => {
|
||||
textAlign="center"
|
||||
variant="h3"
|
||||
color="textPrimary"
|
||||
mb={2}
|
||||
>
|
||||
Login
|
||||
<br />
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid
|
||||
@@ -145,6 +148,7 @@ export const LoginWithImage = () => {
|
||||
direction="column"
|
||||
justifyContent="center"
|
||||
alignItems="center"
|
||||
mb={1}
|
||||
>
|
||||
<AvatarImage userId={userId} />
|
||||
<Typography
|
||||
@@ -244,66 +248,97 @@ export const UserLogin = () => {
|
||||
networkMode: "always",
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<AppBarBackOnly />
|
||||
<Container
|
||||
maxWidth="md"
|
||||
sx={{
|
||||
height: "100vh",
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
{/* <Typography variant="h3" sx={{ marginBottom: "1em" }}>
|
||||
Users
|
||||
</Typography> */}
|
||||
{users.isLoading ? (
|
||||
<CardsSkeleton />
|
||||
) : (
|
||||
<Grid container direction="row">
|
||||
if (users.isLoading) {
|
||||
return <LinearProgress />;
|
||||
}
|
||||
if (users.isSuccess) {
|
||||
return (
|
||||
<>
|
||||
<AppBarBackOnly />
|
||||
<Container
|
||||
maxWidth="md"
|
||||
sx={{
|
||||
height: "100vh",
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<Typography variant="h3" mb={2}>
|
||||
Users
|
||||
</Typography>
|
||||
|
||||
<Grid
|
||||
container
|
||||
columns={{
|
||||
xs: 2,
|
||||
sm: 3,
|
||||
md: 4,
|
||||
}}
|
||||
wrap="nowrap"
|
||||
alignItems="center"
|
||||
overflow="auto"
|
||||
width="100%"
|
||||
mb={3}
|
||||
paddingBottom={2}
|
||||
className="roundedScrollbar"
|
||||
>
|
||||
{users.data.map((item, index) => {
|
||||
return (
|
||||
<Card
|
||||
<Grid
|
||||
key={index}
|
||||
itemName={item.Name}
|
||||
itemId={item.Id}
|
||||
imageTags={!!item.PrimaryImageTag}
|
||||
// cardType="sqaure"
|
||||
iconType="Person"
|
||||
cardOrientation="sqaure"
|
||||
onClickEvent={navigate(
|
||||
`/login/withImg/${item.Name}/${item.Id}/`,
|
||||
)}
|
||||
cardProps={{
|
||||
sx: { width: "33%" },
|
||||
}}
|
||||
/>
|
||||
flexShrink={0}
|
||||
flexGrow={1}
|
||||
xs={1}
|
||||
sm={1}
|
||||
md={1}
|
||||
>
|
||||
<Card
|
||||
key={index}
|
||||
itemName={item.Name}
|
||||
itemId={item.Id}
|
||||
imageTags={
|
||||
!!item.PrimaryImageTag
|
||||
}
|
||||
// cardType="sqaure"
|
||||
iconType="Person"
|
||||
cardOrientation="sqaure"
|
||||
onClickEvent={() =>
|
||||
navigate(
|
||||
`/login/withImg/${item.Name}/${item.Id}/`,
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Grid>
|
||||
);
|
||||
})}
|
||||
</Grid>
|
||||
)}
|
||||
<div className="buttons">
|
||||
<Button
|
||||
color="secondary"
|
||||
variant="contained"
|
||||
className="userEventButton"
|
||||
onClick={handleChangeServer}
|
||||
>
|
||||
Change Server
|
||||
</Button>
|
||||
<Button
|
||||
variant="contained"
|
||||
className="userEventButton"
|
||||
onClick={handleManualLogin}
|
||||
>
|
||||
Manual Login
|
||||
</Button>
|
||||
</div>
|
||||
</Container>
|
||||
</>
|
||||
);
|
||||
|
||||
<div className="buttons">
|
||||
<Button
|
||||
color="secondary"
|
||||
variant="contained"
|
||||
className="userEventButton"
|
||||
onClick={handleChangeServer}
|
||||
>
|
||||
Change Server
|
||||
</Button>
|
||||
<Button
|
||||
variant="contained"
|
||||
className="userEventButton"
|
||||
onClick={handleManualLogin}
|
||||
>
|
||||
Manual Login
|
||||
</Button>
|
||||
</div>
|
||||
</Container>
|
||||
</>
|
||||
);
|
||||
}
|
||||
if (users.isError) {
|
||||
return <ErrorNotice />;
|
||||
}
|
||||
};
|
||||
|
||||
export const UserLoginManual = () => {
|
||||
|
||||
@@ -3,6 +3,11 @@
|
||||
width: 14px;
|
||||
background: $clr-background-dark;
|
||||
}
|
||||
|
||||
.roundedScrollbar::-webkit-scrollbar-track {
|
||||
border-radius: 1000px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: transparent;
|
||||
&:hover {
|
||||
@@ -96,6 +101,7 @@ h1 {
|
||||
height: fit-content;
|
||||
width: inherit;
|
||||
box-sizing: border-box;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.empty {
|
||||
|
||||
Reference in new issue
Block a user