feat: add new about page
This commit is contained in:
9 files changed
+238
-48
No files matched your search
@@ -1,11 +1,4 @@
|
||||
import React, {
|
||||
type MouseEventHandler,
|
||||
useCallback,
|
||||
useMemo,
|
||||
type ReactNode,
|
||||
} from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||
import MuiAppBar from "@mui/material/AppBar";
|
||||
import Avatar from "@mui/material/Avatar";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
@@ -13,22 +6,21 @@ import ListItemIcon from "@mui/material/ListItemIcon";
|
||||
import Menu from "@mui/material/Menu";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import useScrollTrigger from "@mui/material/useScrollTrigger";
|
||||
|
||||
import {
|
||||
Link,
|
||||
useLocation,
|
||||
useNavigate,
|
||||
useRouter,
|
||||
} from "@tanstack/react-router";
|
||||
|
||||
import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api";
|
||||
|
||||
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||
|
||||
import { useLocation, useNavigate, useRouter } from "@tanstack/react-router";
|
||||
import React, {
|
||||
type MouseEventHandler,
|
||||
useCallback,
|
||||
useEffect,
|
||||
useMemo,
|
||||
useState,
|
||||
} from "react";
|
||||
|
||||
import { delUser } from "@/utils/storage/user";
|
||||
import "./appBar.scss";
|
||||
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
import { Divider, Drawer, List, ListItem, ListItemButton } from "@mui/material";
|
||||
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
@@ -36,16 +28,9 @@ import {
|
||||
setSettingsDialogOpen,
|
||||
setSettingsTabValue,
|
||||
} from "@/utils/store/settings";
|
||||
import {
|
||||
Divider,
|
||||
Drawer,
|
||||
List,
|
||||
ListItem,
|
||||
ListItemButton,
|
||||
ListItemText,
|
||||
} from "@mui/material";
|
||||
import BackButton from "../buttons/backButton";
|
||||
import ListItemLink from "../listItemLink";
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
|
||||
|
||||
const MemoizeBackButton = React.memo(BackButton);
|
||||
@@ -262,7 +247,6 @@ export const AppBar = () => {
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
navigate({ to: "/settings/preferences" });
|
||||
setSettingsTabValue(1);
|
||||
handleMenuClose();
|
||||
}}
|
||||
>
|
||||
@@ -273,8 +257,7 @@ export const AppBar = () => {
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
setSettingsDialogOpen(true);
|
||||
setSettingsTabValue(10);
|
||||
navigate({ to: "/settings/about" });
|
||||
handleMenuClose();
|
||||
}}
|
||||
>
|
||||
@@ -319,7 +302,10 @@ export const AppBar = () => {
|
||||
<ListItemLink
|
||||
className="library-drawer-item"
|
||||
key={library.Id}
|
||||
to={`/library/${library.Id}`}
|
||||
to="/library/$id"
|
||||
params={{
|
||||
id: library.Id ?? "",
|
||||
}}
|
||||
icon={
|
||||
library.CollectionType &&
|
||||
getTypeIcon(library.CollectionType)
|
||||
|
||||
@@ -1,19 +1,46 @@
|
||||
import { ListItem, ListItemButton, ListItemText } from "@mui/material";
|
||||
import { Link, type ReactNode } from "@tanstack/react-router";
|
||||
import React from "react";
|
||||
import {
|
||||
ListItem,
|
||||
ListItemButton,
|
||||
type ListItemProps,
|
||||
ListItemText,
|
||||
} from "@mui/material";
|
||||
import { createLink, Link } from "@tanstack/react-router";
|
||||
import React, { forwardRef, type ReactNode } from "react";
|
||||
|
||||
interface ListItemLinkProps {
|
||||
interface MUIListItemLinkProps extends ListItemProps<"a"> {
|
||||
icon?: ReactNode;
|
||||
primary: string;
|
||||
to: string;
|
||||
className?: string;
|
||||
}
|
||||
export default function ListItemLink(props: ListItemLinkProps) {
|
||||
|
||||
const CreatedListItemLink = forwardRef<HTMLAnchorElement, MUIListItemLinkProps>(
|
||||
(props, ref) => (
|
||||
<ListItem component="a" ref={ref} {...props}>
|
||||
<ListItemButton
|
||||
style={{
|
||||
borderRadius: "100px",
|
||||
gap: "0.85em",
|
||||
color: "white",
|
||||
textDecoration: "none",
|
||||
}}
|
||||
>
|
||||
<div className="material-symbols-rounded">{props.icon}</div>
|
||||
<ListItemText primary={props.primary} />
|
||||
</ListItemButton>
|
||||
</ListItem>
|
||||
),
|
||||
);
|
||||
|
||||
const ListItemLink = createLink(CreatedListItemLink);
|
||||
|
||||
export default ListItemLink;
|
||||
|
||||
/* export default function ListItemLink(props: ListItemLinkProps) {
|
||||
const { icon, primary, to, className } = props;
|
||||
|
||||
return (
|
||||
<li>
|
||||
{/* @ts-ignore */}
|
||||
{/* @ts-ignore /*}
|
||||
<ListItem
|
||||
component={Link}
|
||||
activeClassName="active"
|
||||
@@ -35,3 +62,4 @@ export default function ListItemLink(props: ListItemLinkProps) {
|
||||
</li>
|
||||
);
|
||||
}
|
||||
*/
|
||||
Reference in new issue
Block a user