feat: add new about page
This commit is contained in:
9 files changed
+238
-48
No files matched your search
@@ -9,6 +9,8 @@
|
||||
}
|
||||
&-scrollY {
|
||||
padding: 2em;
|
||||
overflow-x: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
&-form{
|
||||
|
||||
@@ -1,29 +1,25 @@
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
import {
|
||||
Link,
|
||||
Outlet,
|
||||
createFileRoute,
|
||||
useNavigate,
|
||||
} from "@tanstack/react-router";
|
||||
import { createFileRoute, Outlet, useNavigate } from "@tanstack/react-router";
|
||||
import React, { useCallback, useEffect } from "react";
|
||||
import { useBackdropStore } from "@/utils/store/backdrop";
|
||||
|
||||
import "./settings.scss";
|
||||
import { Divider, IconButton, List, Typography } from "@mui/material";
|
||||
import { useShallow } from "zustand/shallow";
|
||||
import BackButton from "@/components/buttons/backButton";
|
||||
import ListItemLink from "@/components/listItemLink";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import { Button, Divider, IconButton, List, Typography } from "@mui/material";
|
||||
|
||||
export const Route = createFileRoute("/_api/settings")({
|
||||
component: SettingsRoute,
|
||||
});
|
||||
|
||||
function SettingsRoute() {
|
||||
const setBackdrop = useBackdropStore((s) => s.setBackdrop);
|
||||
const setBackdrop = useBackdropStore(useShallow((s) => s.setBackdrop));
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const user = useCentralStore((s) => s.currentUser);
|
||||
useEffect(() => {
|
||||
setBackdrop("", "none");
|
||||
setBackdrop("");
|
||||
});
|
||||
const navigate = useNavigate();
|
||||
const handleNavigateHome = useCallback(() => {
|
||||
@@ -67,6 +63,12 @@ function SettingsRoute() {
|
||||
primary="Preferences"
|
||||
className="settings-sidebar-list-item"
|
||||
/>
|
||||
<ListItemLink
|
||||
to="/settings/about"
|
||||
icon="info"
|
||||
primary="About"
|
||||
className="settings-sidebar-list-item"
|
||||
/>
|
||||
</List>
|
||||
</div>
|
||||
<Outlet />
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
.settings-about {
|
||||
&-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
&-logo{
|
||||
width: 60%;
|
||||
object-fit: cover;
|
||||
}
|
||||
&-table{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
max-width: 60%;
|
||||
margin-top: 2em;
|
||||
&-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0.5em 1em;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.12);
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
&-links {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
max-width: 60%;
|
||||
margin-top: 2em;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import { Fab, Link, Typography } from "@mui/material";
|
||||
import { createFileRoute } from "@tanstack/react-router";
|
||||
import React from "react";
|
||||
import blinkLogo from "@/assets/logoBlackTransparent.png";
|
||||
import { version } from "../../../../package.json";
|
||||
|
||||
import "./about.scss";
|
||||
import { useSuspenseQuery } from "@tanstack/react-query";
|
||||
import {
|
||||
getSystemInfoQueryOptions,
|
||||
getUpdateQueryOptions,
|
||||
} from "@/utils/queries/about";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
|
||||
export const Route = createFileRoute("/_api/settings/about")({
|
||||
component: RouteComponent,
|
||||
loader: async ({ context: { queryClient, api } }) => {
|
||||
await queryClient.ensureQueryData(getSystemInfoQueryOptions(api));
|
||||
await queryClient.ensureQueryData(getUpdateQueryOptions);
|
||||
},
|
||||
});
|
||||
|
||||
function RouteComponent() {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
const systemInfo = useSuspenseQuery(getSystemInfoQueryOptions(api));
|
||||
const updateInfo = useSuspenseQuery(getUpdateQueryOptions);
|
||||
|
||||
return (
|
||||
<div className="settings-page-scrollY settings-about-container">
|
||||
{/* <Typography variant="h4">About</Typography> */}
|
||||
<img src={blinkLogo} alt="Blink" className="settings-about-logo" />
|
||||
<Typography sx={{ opacity: 0.8, marginTop: "-4em" }}>
|
||||
v{version}
|
||||
</Typography>
|
||||
<div className="settings-about-table">
|
||||
<div className="settings-about-table-row">
|
||||
<Typography variant="subtitle1">Server Name</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
{systemInfo.data.ServerName}
|
||||
</Typography>
|
||||
</div>
|
||||
<div className="settings-about-table-row">
|
||||
<Typography variant="subtitle1">Jellyfin Version</Typography>
|
||||
<Typography variant="subtitle1">{systemInfo.data.Version}</Typography>
|
||||
</div>
|
||||
<div className="settings-about-table-row">
|
||||
<Typography variant="subtitle1">Update Available</Typography>
|
||||
<Typography variant="subtitle1">
|
||||
{updateInfo.data
|
||||
? `v${updateInfo.data.version}`
|
||||
: "No update available."}
|
||||
</Typography>
|
||||
</div>
|
||||
</div>
|
||||
<div className="settings-about-links">
|
||||
<Typography variant="h6" style={{ marginBottom: "0.5em" }}>
|
||||
Links
|
||||
</Typography>
|
||||
<Link href="https://github.com/prayag17/Blink">
|
||||
https://github.com/prayag17/Blink
|
||||
</Link>
|
||||
<Link href="https://jellyfin.org">https://jellyfin.org</Link>
|
||||
</div>
|
||||
<Fab
|
||||
LinkComponent={Link}
|
||||
href="https://github.com/sponsors/prayag17"
|
||||
variant="extended"
|
||||
target="_blank"
|
||||
color="primary"
|
||||
sx={{
|
||||
position: "fixed",
|
||||
bottom: "2em",
|
||||
right: "2em",
|
||||
}}
|
||||
>
|
||||
<span
|
||||
className="material-symbols-rounded fill"
|
||||
style={{
|
||||
marginRight: "0.25em",
|
||||
}}
|
||||
>
|
||||
volunteer_activism
|
||||
</span>
|
||||
Support
|
||||
</Fab>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user