diff --git a/package-lock.json b/package-lock.json index 911342d..1faad8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "jellyplayer-react", + "name": "jellyplayer", "version": "0.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "jellyplayer-react", + "name": "jellyplayer", "version": "0.0.0", "license": "GPL-3.0-only", "dependencies": { @@ -13,6 +13,7 @@ "@emotion/styled": "^11.10.5", "@fontsource/open-sans": "^4.5.13", "@jellyfin/sdk": "^0.7.0", + "@mdi/js": "^7.1.96", "@mui/lab": "^5.0.0-alpha.110", "@mui/material": "^5.10.15", "events": "^3.3.0", @@ -673,6 +674,11 @@ "@jridgewell/sourcemap-codec": "1.4.14" } }, + "node_modules/@mdi/js": { + "version": "7.1.96", + "resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.1.96.tgz", + "integrity": "sha512-wlrJs6Ryhaa5CqhK3FjTfMRnb/s7HeLkKMFqwQySkK86cdN1TGdzpSM3O4tsmzCA1dYBeTbXvOwSE/Y42cUrvA==" + }, "node_modules/@motionone/animation": { "version": "10.15.1", "resolved": "https://registry.npmjs.org/@motionone/animation/-/animation-10.15.1.tgz", @@ -3673,6 +3679,11 @@ "@jridgewell/sourcemap-codec": "1.4.14" } }, + "@mdi/js": { + "version": "7.1.96", + "resolved": "https://registry.npmjs.org/@mdi/js/-/js-7.1.96.tgz", + "integrity": "sha512-wlrJs6Ryhaa5CqhK3FjTfMRnb/s7HeLkKMFqwQySkK86cdN1TGdzpSM3O4tsmzCA1dYBeTbXvOwSE/Y42cUrvA==" + }, "@motionone/animation": { "version": "10.15.1", "resolved": "https://registry.npmjs.org/@motionone/animation/-/animation-10.15.1.tgz", diff --git a/package.json b/package.json index 7d8af20..58d1544 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@emotion/styled": "^11.10.5", "@fontsource/open-sans": "^4.5.13", "@jellyfin/sdk": "^0.7.0", + "@mdi/js": "^7.1.96", "@mui/lab": "^5.0.0-alpha.110", "@mui/material": "^5.10.15", "events": "^3.3.0", diff --git a/src/components/appBar/backOnly.jsx b/src/components/appBar/backOnly.jsx index 126fa7b..033a57a 100644 --- a/src/components/appBar/backOnly.jsx +++ b/src/components/appBar/backOnly.jsx @@ -3,7 +3,7 @@ import AppBar from "@mui/material/AppBar"; import Toolbar from "@mui/material/Toolbar"; import IconButton from "@mui/material/IconButton"; -import ArrowLeft from "mdi-material-ui/ArrowLeft"; +import { MdiArrowLeft } from "../icons/mdiArrowLeft"; import { useNavigate } from "react-router-dom"; export const AppBarBackOnly = () => { @@ -24,7 +24,7 @@ export const AppBarBackOnly = () => { onClick={handleBack} sx={{ mr: 2 }} > - + diff --git a/src/components/avatar/avatar.jsx b/src/components/avatar/avatar.jsx index 46000da..ebcc84f 100644 --- a/src/components/avatar/avatar.jsx +++ b/src/components/avatar/avatar.jsx @@ -22,6 +22,7 @@ export const AvatarCard = ({ userName, userId, userImageAvailable }) => { "/Users/" + userId + "/Images/Primary')", + // http://localhost/Users/{userId}/Images/{imageType} }} > ) : ( diff --git a/src/components/avatar/avatar.module.scss b/src/components/avatar/avatar.module.scss index ff263e1..a5593df 100644 --- a/src/components/avatar/avatar.module.scss +++ b/src/components/avatar/avatar.module.scss @@ -13,6 +13,8 @@ gap: 0.5em; margin-bottom: 0.5em; .card-image { + position: absolute; + inset: 0; &-container { font-size: 5em; } @@ -36,12 +38,22 @@ } .avatar-image { + aspect-ratio: 1; + height: 100%; + position: absolute; + inset: 0; + background-size: cover; + background-position: center; + &-container { width: fit-content; aspect-ratio: 1; + position: relative; + border-radius: 100vh; + overflow: hidden; } &-icon { - border-radius: 100%; + height: 100%; padding: 0.2em; background: $clr-accent-dark; color: $clr-accent-default; diff --git a/src/components/icons/mdiArrowLeft.jsx b/src/components/icons/mdiArrowLeft.jsx new file mode 100644 index 0000000..b4d69fa --- /dev/null +++ b/src/components/icons/mdiArrowLeft.jsx @@ -0,0 +1,13 @@ +/** @format */ + +import SvgIcon from "@mui/material/SvgIcon"; + +import { mdiArrowLeft } from "@mdi/js"; + +export const MdiArrowLeft = () => { + return ( + + + + ); +}; diff --git a/src/components/icons/mdiChevronRight.jsx b/src/components/icons/mdiChevronRight.jsx new file mode 100644 index 0000000..d4253f6 --- /dev/null +++ b/src/components/icons/mdiChevronRight.jsx @@ -0,0 +1,13 @@ +/** @format */ + +import SvgIcon from "@mui/material/SvgIcon"; + +import { mdiChevronRight } from "@mdi/js"; + +export const MdiChevronRight = () => { + return ( + + + + ); +}; diff --git a/src/components/icons/mdiEyeOffOutline.jsx b/src/components/icons/mdiEyeOffOutline.jsx new file mode 100644 index 0000000..4b67992 --- /dev/null +++ b/src/components/icons/mdiEyeOffOutline.jsx @@ -0,0 +1,13 @@ +/** @format */ + +import SvgIcon from "@mui/material/SvgIcon"; + +import { mdiEyeOffOutline } from "@mdi/js"; + +export const MdiEyeOffOutline = () => { + return ( + + + + ); +}; diff --git a/src/components/icons/mdiEyeOutline.jsx b/src/components/icons/mdiEyeOutline.jsx new file mode 100644 index 0000000..d2f44ea --- /dev/null +++ b/src/components/icons/mdiEyeOutline.jsx @@ -0,0 +1,13 @@ +/** @format */ + +import SvgIcon from "@mui/material/SvgIcon"; + +import { mdiEyeOutline } from "@mdi/js"; + +export const MdiEyeOutline = () => { + return ( + + + + ); +}; diff --git a/src/components/splashscreen/splash.jsx b/src/components/splashscreen/splash.jsx new file mode 100644 index 0000000..9a9edfb --- /dev/null +++ b/src/components/splashscreen/splash.jsx @@ -0,0 +1,5 @@ +/** @format */ + +export const SplashScreen = () => { + return

I am loading...

; +}; diff --git a/src/routes/login/root.jsx b/src/routes/login/root.jsx index bd2f20b..6c29cd3 100644 --- a/src/routes/login/root.jsx +++ b/src/routes/login/root.jsx @@ -7,9 +7,9 @@ import { EventEmitter as event } from "../../eventEmitter.js"; import { motion } from "framer-motion"; // import Icon from "mdi-material-ui"; -import EyeOffOutline from "mdi-material-ui/EyeOffOutline"; -import EyeOutline from "mdi-material-ui/EyeOutline"; -import ChevronRight from "mdi-material-ui/ChevronRight"; +import { MdiEyeOffOutline } from "../../components/icons/mdiEyeOffOutline"; +import { MdiEyeOutline } from "../../components/icons/mdiEyeOutline"; +import { MdiChevronRight } from "../../components/icons/mdiChevronRight"; import Container from "@mui/material/Container"; import Grid from "@mui/material/Grid"; @@ -19,7 +19,6 @@ import FormControl from "@mui/material/FormControl"; import InputAdornment from "@mui/material/InputAdornment"; import InputLabel from "@mui/material/InputLabel"; import IconButton from "@mui/material/IconButton"; -import Avatar from "@mui/material/Avatar"; import LoadingButton from "@mui/lab/LoadingButton"; import Button from "@mui/material/Button"; import { useSnackbar } from "notistack"; @@ -101,7 +100,12 @@ export const LoginWithImage = () => {
- + { aria-label="toggle password visibility" > {password.showpass ? ( - + ) : ( - + )} @@ -149,7 +153,7 @@ export const LoginWithImage = () => { } + endIcon={} onClick={handleLogin} loading={loading} loadingPosition="end" @@ -188,8 +192,9 @@ export const UserLogin = () => { useEffect(() => { getUsers().then((users) => { setUsers(users.data); + console.log(userList); }); - }); + }, []); return ( <> @@ -206,16 +211,16 @@ export const UserLogin = () => { className="userCard" index={index} > - {item.ImageTags == undefined ? ( + {item.PrimaryImageTag ? ( ) : ( )} @@ -360,9 +365,9 @@ export const UserLoginManual = () => { aria-label="toggle password visibility" > {password.showpass ? ( - + ) : ( - + )} @@ -373,7 +378,7 @@ export const UserLoginManual = () => { } + endIcon={} onClick={handleLogin} loading={loading} loadingPosition="end" diff --git a/src/routes/setup/server/root.jsx b/src/routes/setup/server/root.jsx index 290c045..b345d88 100644 --- a/src/routes/setup/server/root.jsx +++ b/src/routes/setup/server/root.jsx @@ -12,11 +12,14 @@ import { getSystemApi } from "@jellyfin/sdk/lib/utils/api/system-api"; import TextField from "@mui/material/TextField"; import Typography from "@mui/material/Typography"; import Grid from "@mui/material/Grid"; -import ListItem from "@mui/material/ListItem"; -import ListItemText from "@mui/material/ListItemText"; +import LoadingButton from "@mui/lab/LoadingButton"; +import SvgIcon from "@mui/material/SvgIcon"; import Button from "@mui/material/Button"; import LinearProgress from "@mui/material/LinearProgress"; import Container from "@mui/material/Container"; + +import { mdiChevronRight } from "@mdi/js"; + import { useSnackbar } from "notistack"; // Svgs @@ -130,6 +133,8 @@ export const ServerSetup = (props) => { const [currentServer, setCurrentServer] = useCookies(["currentServer"]); const cookies = new Cookies(); + const [loading, setLoading] = useState(false); + const addServer = async () => { event.emit("create-jellyfin-api", serverIp); let sysInfo = await getSystemApi(window.api).getPublicSystemInfo(); @@ -156,8 +161,9 @@ export const ServerSetup = (props) => { }; const handleAddServer = () => { + setLoading(true); let data; - setServerCheckState(true); + // setServerCheckState(true); fetch(`${serverIp}/System/Ping`, { body: JSON.stringify(data), }) @@ -165,20 +171,23 @@ export const ServerSetup = (props) => { .then((data) => { if (data == "Jellyfin Server") { console.log(true); - setServerCheckState(false); + // setServerCheckState(false); addServer(); + setLoading(false); return true; } else { - setServerCheckState(false); + // setServerCheckState(false); enqueueSnackbar( "The server address does not seem be a jellyfin server", { variant: "error" }, ); + setLoading(false); return false; } }) .catch((error) => { - setServerCheckState(false); + // setServerCheckState(false); + setLoading(false); enqueueSnackbar( "Unable to verify whether the give address is a valid Jellyfin server", { variant: "error" }, @@ -189,7 +198,6 @@ export const ServerSetup = (props) => { return ( <> - {checkingServer && } {isJfServer && } { > - +