diff --git a/src/components/addServerDialog/index.tsx b/src/components/addServerDialog/index.tsx index c8e42b5..5ccb9f0 100644 --- a/src/components/addServerDialog/index.tsx +++ b/src/components/addServerDialog/index.tsx @@ -106,15 +106,16 @@ export default function AddServerDialog(props: AddServerDialogProps) { p: "2px 16px", bgcolor: "rgba(0,0,0,0.2)", borderRadius: 2, - border: "1px solid rgba(255,255,255,0.05)", + border: "1px solid", + borderColor: "rgba(255,255,255,0.05)", display: "flex", alignItems: "center", gap: 2, "&:focus-within": { - border: "1px solid var(--mui-palette-primary-main)", + borderColor: "var(--mui-palette-primary-main)", bgcolor: "rgba(0,0,0,0.3)", }, - transition: "all 0.2s", + transition: "border-color 0.2s, background-color 0.2s", }} > diff --git a/src/components/appBar/appBar.scss b/src/components/appBar/appBar.scss index 0875b68..2f2024d 100644 --- a/src/components/appBar/appBar.scss +++ b/src/components/appBar/appBar.scss @@ -90,48 +90,98 @@ } } -.library-drawer{ - width: 20em; - margin: 1.4em; - height: calc(100vh - 2.8em) !important; - border-radius: 20px; - overflow-x: hidden; - overflow-y: auto; - .library-drawer-item{ - position: relative; - overflow: hidden; - border-radius: 1000px; - > div::before{ - content: ""; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: transparent; - transition: $transition-time-default; - z-index: -1; - border-radius: 100px; +.library-drawer { + // Ensure the drawer paper itself gets the styling + &.MuiDrawer-paper { + width: 280px; + margin: 16px; + height: calc(100% - 32px) !important; // float in the middle + border-radius: 24px; + background: rgba(20, 20, 25, 0.75); // Darker, substantial base + backdrop-filter: blur(24px) saturate(180%); + border: 1px solid rgba(255, 255, 255, 0.06); + box-shadow: + 0 24px 48px rgba(0, 0, 0, 0.4), + 0 4px 8px rgba(0, 0, 0, 0.2); + overflow: hidden; // Contain scrollbars + } + + .MuiList-root { + padding: 8px; // Reduced from 16px + gap: 2px; // Reduced gap + } + + .MuiDivider-root { + border-color: rgba(255, 255, 255, 0.1); + margin: 4px 12px; // Reduced margins + } + + // Navigation Items + .MuiListItemButton-root { + border-radius: 12px !important; // Slightly smaller radius + padding: 8px 12px; // Reduced padding (was 12px 16px) + margin-bottom: 2px; + transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); + color: rgba(255, 255, 255, 0.6); + + &:hover { + background: rgba(255, 255, 255, 0.08); + color: #fff; + transform: scale(1.02); + } + + .material-symbols-rounded { + margin-right: 12px; // Reduced spacing + font-size: 22px; // Slightly smaller icons usually look better with less padding + transition: all 0.2s ease; + color: inherit; + } + + .MuiListItemText-primary { + font-weight: 600; + font-size: 0.9rem; // Slightly smaller text + letter-spacing: 0.02em; } } - .active.library-drawer-item { - .material-symbols-rounded{ - --fill: 1; - } - &> div::before { - background: $clr-accent-default; + + // Active State + .library-drawer-item.active { + .MuiListItemButton-root { + background: linear-gradient(90deg, rgba($clr-accent-default, 0.2), rgba($clr-accent-default, 0.05)); + color: $clr-accent-default; + + .material-symbols-rounded { + font-variation-settings: 'FILL' 1; + color: $clr-accent-default; + } + + // Active Indicator Bar + &::before { + content: ''; + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + height: 24px; + width: 4px; + background: $clr-accent-default; + border-radius: 0 4px 4px 0; + } } } - // Magic scrollbar + + // Custom Scrollbar for the drawer content &::-webkit-scrollbar { - &-thumb { - height: 150px; - max-height: 33%; - } - &-track { - margin-top: 15px; - margin-bottom: 15px; - background: transparent !important; + width: 4px; + } + &::-webkit-scrollbar-track { + background: transparent; + } + &::-webkit-scrollbar-thumb { + background: rgba(255, 255, 255, 0.1); + border-radius: 4px; + &:hover { + background: rgba(255, 255, 255, 0.2); } } } diff --git a/src/components/appBar/appBar.tsx b/src/components/appBar/appBar.tsx index 521c75c..b45f695 100644 --- a/src/components/appBar/appBar.tsx +++ b/src/components/appBar/appBar.tsx @@ -1,29 +1,20 @@ -import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api"; import MuiAppBar from "@mui/material/AppBar"; import IconButton from "@mui/material/IconButton"; import useScrollTrigger from "@mui/material/useScrollTrigger"; -import { useQuery } from "@tanstack/react-query"; - import { useLocation, useNavigate } from "@tanstack/react-router"; import React, { useCallback, useMemo, useState } from "react"; import "./appBar.scss"; -import { Divider, Drawer, List, ListItem, ListItemButton } from "@mui/material"; import { useShallow } from "zustand/shallow"; // removed search placeholder; library state now managed via zustand import { useApiInContext } from "@/utils/store/api"; import { useCentralStore } from "@/utils/store/central"; import useHeaderStore from "@/utils/store/header"; import useSearchStore from "@/utils/store/search"; -import { - setSettingsDialogOpen, - setSettingsTabValue, -} from "@/utils/store/settings"; import BackButton from "../buttons/backButton"; -import ListItemLink from "../listItemLink"; import { UserAvatarMenu } from "../userAvatarMenu"; -import { getTypeIcon } from "../utils/iconsCollection"; +import { NavigationDrawer } from "./navigationDrawer"; const MemoizeBackButton = React.memo(BackButton); @@ -39,8 +30,6 @@ const HIDDEN_PATHS = [ ]; export const AppBar = () => { - const api = useApiInContext((s) => s.api); - const navigate = useNavigate(); const location = useLocation(); @@ -55,23 +44,6 @@ export const AppBar = () => { location.pathname === "/", ); - - const [user] = useCentralStore((s) => [s.currentUser]); - const libraries = useQuery({ - queryKey: ["libraries"], - queryFn: async () => { - if (!user?.Id || !api?.accessToken) { - return; - } - const libs = await getUserViewsApi(api).getUserViews({ - userId: user.Id, - }); - return libs.data; - }, - enabled: !!user?.Id && !!api?.accessToken, - networkMode: "always", - }); - const trigger = useScrollTrigger({ disableHysteresis: true, threshold: 20, @@ -86,13 +58,6 @@ export const AppBar = () => { }; }, []); - const drawerPaperProps = useMemo(() => { - return { - className: "glass library-drawer", - elevation: 6, - }; - }, []); - const _handleNavigateToSearch = useCallback( () => navigate({ to: "/search", search: { query: "" } }), [navigate], @@ -157,92 +122,8 @@ export const AppBar = () => { - - - - - menu_open - Close - - - - - - - {libraries.isSuccess && - libraries.data?.Items?.map((library) => ( - - ))} - - - - - - - - - dns - Change Server - - - - { - setSettingsDialogOpen(true); - setSettingsTabValue(10); - }} - style={{ - borderRadius: "100px", - gap: "0.85em", - }} - > - info - About - - - - + ); } -}; +}; \ No newline at end of file diff --git a/src/components/appBar/navigationDrawer.tsx b/src/components/appBar/navigationDrawer.tsx new file mode 100644 index 0000000..bea75ee --- /dev/null +++ b/src/components/appBar/navigationDrawer.tsx @@ -0,0 +1,107 @@ +import { getUserViewsApi } from "@jellyfin/sdk/lib/utils/api/user-views-api"; +import { Divider, Drawer, List, ListItem, ListItemButton } from "@mui/material"; +import { useQuery } from "@tanstack/react-query"; +import React, { useMemo } from "react"; +import { useApiInContext } from "@/utils/store/api"; +import { useCentralStore } from "@/utils/store/central"; +import ListItemLink from "../listItemLink"; +import { getTypeIcon } from "../utils/iconsCollection"; + +interface NavigationDrawerProps { + open: boolean; + onClose: () => void; +} + +export const NavigationDrawer = ({ open, onClose }: NavigationDrawerProps) => { + const api = useApiInContext((s) => s.api); + const [user] = useCentralStore((s) => [s.currentUser]); + + const libraries = useQuery({ + queryKey: ["libraries"], + queryFn: async () => { + if (!user?.Id || !api?.accessToken) { + return; + } + const libs = await getUserViewsApi(api).getUserViews({ + userId: user.Id, + }); + return libs.data; + }, + enabled: !!user?.Id && !!api?.accessToken, + networkMode: "always", + }); + + const drawerPaperProps = useMemo(() => { + return { + className: "glass library-drawer", + elevation: 6, + }; + }, []); + + return ( + + + + + menu_open +
Close
+
+
+
+ + + + {libraries.isSuccess && + libraries.data?.Items?.map((library) => ( + + ))} + + + + + + + +
+ ); +}; diff --git a/src/components/libraryHeader/index.tsx b/src/components/libraryHeader/index.tsx index bee146d..0555f5f 100644 --- a/src/components/libraryHeader/index.tsx +++ b/src/components/libraryHeader/index.tsx @@ -13,17 +13,18 @@ import { import { useQueryClient, useSuspenseQuery } from "@tanstack/react-query"; import { getRouteApi, useNavigate } from "@tanstack/react-router"; import type { ChangeEvent } from "react"; -import React, { useCallback, useEffect, useMemo } from "react"; +import React, { useCallback, useEffect, useMemo, useState } from "react"; import { useShallow } from "zustand/shallow"; import { AVAILABLE_VIEWS, SORT_BY_OPTIONS } from "@/utils/constants/library"; import { getLibraryQueryOptions } from "@/utils/queries/library"; // import removed: header reads name/count from Zustand slice import { useLibraryStateStore } from "@/utils/store/libraryState"; -import "./libraryHeader.scss"; import useSearchStore from "@/utils/store/search"; +import { NavigationDrawer } from "../appBar/navigationDrawer"; import BackButton from "../buttons/backButton"; import { FiltersDialogTrigger } from "../filtersDialog"; import { UserAvatarMenu } from "../userAvatarMenu"; +import "./libraryHeader.scss"; const route = getRouteApi("/_api/library/$id"); @@ -244,143 +245,156 @@ export const LibraryHeader = () => { [navigate], ); + const [showDrawer, setShowDrawer] = useState(false); + + const handleDrawerClose = useCallback(() => { + setShowDrawer(false); + }, []); + + const handleDrawerOpen = useCallback(() => { + setShowDrawer(true); + }, []); + return ( - -
- -
menu
-
- - -
- home -
-
-
-
+ -
- - {libraryName} - - {typeof totalCount === "number" && ( - - )} +
+ +
menu
+
+ + +
+ home +
+
- - - - View - - - {compatibleViews.map((v) => ( - - {v.title} - - ))} - -
+ + {libraryName} + + {typeof totalCount === "number" && ( + + )} +
+ - sort -
- - - - - Sort By - - - {SORT_BY_OPTIONS.map((option) => { - const isCompatible = - option.compatibleViewTypes?.includes(currentViewType as any) || - option.compatibleCollectionTypes?.includes( - currentLibrary.data.CollectionType as any, - ); - if (!isCompatible) return null; - const valueStr = Array.isArray(option.value) - ? option.value.join(",") - : option.value; - return ( - - prefetchItems(String(valueStr), sortAscending) - } - > - {option.title} + + + View + + + {compatibleViews.map((v) => ( + + {v.title} - ); - })} - - -
-
- -
search
-
- -
favorite
-
- -
-
+ ))} + + +
+ sort +
+
+ + + + Sort By + + + {SORT_BY_OPTIONS.map((option) => { + const isCompatible = + option.compatibleViewTypes?.includes(currentViewType as any) || + option.compatibleCollectionTypes?.includes( + currentLibrary.data.CollectionType as any, + ); + if (!isCompatible) return null; + const valueStr = Array.isArray(option.value) + ? option.value.join(",") + : option.value; + return ( + + prefetchItems(String(valueStr), sortAscending) + } + > + {option.title} + + ); + })} + + + +
+ +
search
+
+ +
favorite
+
+ +
+ + + ); }; diff --git a/src/components/listItemLink/index.tsx b/src/components/listItemLink/index.tsx index a6106a9..be2f5dd 100644 --- a/src/components/listItemLink/index.tsx +++ b/src/components/listItemLink/index.tsx @@ -17,10 +17,8 @@ const CreatedListItemLink = forwardRef( (props, ref) => ( @@ -40,7 +38,7 @@ export default ListItemLink; return (
  • - {/* @ts-ignore /*} + {/* @ts-expect-error /*}
    - + home
    - +
    user
    - {user?.Name} - - {user?.Policy?.IsAdministrator ? "administrator" : "user"} + + {user?.Name} + + + {user?.Policy?.IsAdministrator ? "Administrator" : "User"}
    - + + + General + + + + System + delete