Start moving to @mdi/js for Icons
This commit is contained in:
12 files changed
+131
-29
No files matched your search
Generated
+13
-2
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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 }}
|
||||
>
|
||||
<ArrowLeft />
|
||||
<MdiArrowLeft />
|
||||
</IconButton>
|
||||
</Toolbar>
|
||||
</AppBar>
|
||||
|
||||
@@ -22,6 +22,7 @@ export const AvatarCard = ({ userName, userId, userImageAvailable }) => {
|
||||
"/Users/" +
|
||||
userId +
|
||||
"/Images/Primary')",
|
||||
// http://localhost/Users/{userId}/Images/{imageType}
|
||||
}}
|
||||
></div>
|
||||
) : (
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiArrowLeft } from "@mdi/js";
|
||||
|
||||
export const MdiArrowLeft = () => {
|
||||
return (
|
||||
<SvgIcon>
|
||||
<path d={mdiArrowLeft}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiChevronRight } from "@mdi/js";
|
||||
|
||||
export const MdiChevronRight = () => {
|
||||
return (
|
||||
<SvgIcon>
|
||||
<path d={mdiChevronRight}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiEyeOffOutline } from "@mdi/js";
|
||||
|
||||
export const MdiEyeOffOutline = () => {
|
||||
return (
|
||||
<SvgIcon>
|
||||
<path d={mdiEyeOffOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
/** @format */
|
||||
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
|
||||
import { mdiEyeOutline } from "@mdi/js";
|
||||
|
||||
export const MdiEyeOutline = () => {
|
||||
return (
|
||||
<SvgIcon>
|
||||
<path d={mdiEyeOutline}></path>
|
||||
</SvgIcon>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
/** @format */
|
||||
|
||||
export const SplashScreen = () => {
|
||||
return <h1>I am loading...</h1>;
|
||||
};
|
||||
+20
-15
@@ -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 = () => {
|
||||
<br />
|
||||
</Typography>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Grid
|
||||
container
|
||||
direction="column"
|
||||
justifyContent="center"
|
||||
alignItems="center"
|
||||
>
|
||||
<AvatarImage userId={userId} />
|
||||
<Typography
|
||||
color="textPrimary"
|
||||
@@ -136,9 +140,9 @@ export const LoginWithImage = () => {
|
||||
aria-label="toggle password visibility"
|
||||
>
|
||||
{password.showpass ? (
|
||||
<EyeOffOutline />
|
||||
<MdiEyeOffOutline />
|
||||
) : (
|
||||
<EyeOutline />
|
||||
<MdiEyeOutline />
|
||||
)}
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
@@ -149,7 +153,7 @@ export const LoginWithImage = () => {
|
||||
<Grid item minWidth="100%">
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
endIcon={<ChevronRight />}
|
||||
endIcon={<MdiChevronRight />}
|
||||
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 ? (
|
||||
<AvatarCard
|
||||
userName={item.Name}
|
||||
userId={item.Id}
|
||||
userImageAvailable={false}
|
||||
userImageAvailable={true}
|
||||
></AvatarCard>
|
||||
) : (
|
||||
<AvatarCard
|
||||
userName={item.Name}
|
||||
userImageAvailable={true}
|
||||
userImageAvailable={false}
|
||||
></AvatarCard>
|
||||
)}
|
||||
</Link>
|
||||
@@ -360,9 +365,9 @@ export const UserLoginManual = () => {
|
||||
aria-label="toggle password visibility"
|
||||
>
|
||||
{password.showpass ? (
|
||||
<EyeOffOutline />
|
||||
<MdiEyeOffOutline />
|
||||
) : (
|
||||
<EyeOutline />
|
||||
<MdiEyeOutline />
|
||||
)}
|
||||
</IconButton>
|
||||
</InputAdornment>
|
||||
@@ -373,7 +378,7 @@ export const UserLoginManual = () => {
|
||||
<Grid item xl={5} md={6} sx={{ width: "100%" }}>
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
endIcon={<ChevronRight />}
|
||||
endIcon={<MdiChevronRight />}
|
||||
onClick={handleLogin}
|
||||
loading={loading}
|
||||
loadingPosition="end"
|
||||
|
||||
@@ -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 && <LinearProgress />}
|
||||
{isJfServer && <Navigate to="/login" />}
|
||||
<Container
|
||||
maxWidth="md"
|
||||
@@ -222,14 +230,21 @@ export const ServerSetup = (props) => {
|
||||
></TextField>
|
||||
</Grid>
|
||||
<Grid item xl={5} md={6} sx={{ width: "100%" }}>
|
||||
<Button
|
||||
<LoadingButton
|
||||
variant="contained"
|
||||
sx={{ width: "100%" }}
|
||||
size="large"
|
||||
loading={loading}
|
||||
endIcon={
|
||||
<SvgIcon>
|
||||
<path d={mdiChevronRight}></path>
|
||||
</SvgIcon>
|
||||
}
|
||||
loadingPosition="end"
|
||||
onClick={handleAddServer}
|
||||
>
|
||||
Add Server
|
||||
</Button>
|
||||
</LoadingButton>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Container>
|
||||
|
||||
Reference in new issue
Block a user