feat: add new server page
This commit is contained in:
13 files changed
+506
-69
No files matched your search
@@ -203,30 +203,23 @@ export const AppBar = () => {
|
||||
<Divider variant="middle" />
|
||||
<List>
|
||||
<ListItem>
|
||||
<ListItemButton
|
||||
onClick={() => {
|
||||
setSettingsDialogOpen(true);
|
||||
setSettingsTabValue(1);
|
||||
}}
|
||||
<ListItemLink
|
||||
to="/settings"
|
||||
icon="settings"
|
||||
primary="Settings"
|
||||
style={{
|
||||
borderRadius: "100px",
|
||||
gap: "0.85em",
|
||||
}}
|
||||
>
|
||||
<span className="material-symbols-rounded">settings</span>
|
||||
Settings
|
||||
</ListItemButton>
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
<ListItemButton
|
||||
onClick={() => {
|
||||
setSettingsDialogOpen(true);
|
||||
setSettingsTabValue(2);
|
||||
}}
|
||||
style={{
|
||||
borderRadius: "100px",
|
||||
gap: "0.85em",
|
||||
}}
|
||||
disabled
|
||||
>
|
||||
<span className="material-symbols-rounded">dns</span>
|
||||
Change Server
|
||||
|
||||
@@ -89,6 +89,15 @@
|
||||
border-radius: 8px;
|
||||
object-fit: cover;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.2);
|
||||
|
||||
&.placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgb(100 100 100 / 0.1);
|
||||
color: rgb(200 200 200 / 0.7);
|
||||
font-size: 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
& > div {
|
||||
|
||||
@@ -113,14 +113,16 @@ const Carousel = ({
|
||||
>
|
||||
<CarouselTickers
|
||||
imageUrl={
|
||||
getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.Id ?? "",
|
||||
"Thumb",
|
||||
{
|
||||
quality: 90,
|
||||
fillHeight: 360,
|
||||
},
|
||||
) ?? undefined
|
||||
item.ImageTags?.Thumb
|
||||
? getImageUrlsApi(api).getItemImageUrlById(
|
||||
item.Id ?? "",
|
||||
"Thumb",
|
||||
{
|
||||
quality: 90,
|
||||
fillHeight: 360,
|
||||
},
|
||||
)
|
||||
: undefined
|
||||
}
|
||||
isActive={index === currentSlide}
|
||||
itemName={item.Name ?? "Unknown"}
|
||||
@@ -131,6 +133,7 @@ const Carousel = ({
|
||||
}
|
||||
onTickerClick={handleTickerClick}
|
||||
index={index}
|
||||
itemType={item.Type as BaseItemKind}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import type { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { Typography } from "@mui/material";
|
||||
import React from "react";
|
||||
import { getTypeIcon } from "../utils/iconsCollection";
|
||||
|
||||
type CarouselTickersProps = {
|
||||
imageUrl?: string;
|
||||
imageUrl?: string | undefined | null;
|
||||
itemName: string;
|
||||
itemYear: string;
|
||||
onTickerClick: (index: number) => void;
|
||||
index: number;
|
||||
isActive: boolean;
|
||||
itemType: BaseItemKind;
|
||||
};
|
||||
|
||||
const CarouselTickers = React.memo(
|
||||
@@ -18,6 +21,7 @@ const CarouselTickers = React.memo(
|
||||
onTickerClick,
|
||||
index,
|
||||
isActive,
|
||||
itemType,
|
||||
}: CarouselTickersProps) => {
|
||||
const handleClick = React.useCallback(() => {
|
||||
onTickerClick(index);
|
||||
@@ -28,12 +32,18 @@ const CarouselTickers = React.memo(
|
||||
className={`carousel-ticker${isActive ? " active" : ""}`}
|
||||
onClick={handleClick}
|
||||
>
|
||||
<img
|
||||
src={imageUrl}
|
||||
alt={itemName}
|
||||
className="carousel-ticker-image"
|
||||
// style={{ width: "5em", height: "100%", objectFit: "cover" }}
|
||||
/>
|
||||
{imageUrl ? (
|
||||
<img
|
||||
src={imageUrl}
|
||||
alt={itemName}
|
||||
className="carousel-ticker-image"
|
||||
/>
|
||||
) : (
|
||||
<div className="carousel-ticker-image placeholder material-symbols-rounded">
|
||||
{" "}
|
||||
{getTypeIcon(itemType)}
|
||||
</div>
|
||||
)}
|
||||
<div>
|
||||
<Typography variant="subtitle1" className="carousel-ticker-title">
|
||||
{itemName}
|
||||
|
||||
@@ -17,10 +17,6 @@ import React, {
|
||||
import { delUser } from "@/utils/storage/user";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import { useCentralStore } from "@/utils/store/central";
|
||||
import {
|
||||
setSettingsDialogOpen,
|
||||
setSettingsTabValue,
|
||||
} from "@/utils/store/settings";
|
||||
|
||||
export const UserAvatarMenu = () => {
|
||||
const api = useApiInContext((s) => s.api);
|
||||
@@ -105,18 +101,6 @@ export const UserAvatarMenu = () => {
|
||||
Logout
|
||||
</MenuItem>
|
||||
<Divider />
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
setSettingsDialogOpen(true);
|
||||
setSettingsTabValue(1);
|
||||
handleMenuClose();
|
||||
}}
|
||||
>
|
||||
<ListItemIcon>
|
||||
<span className="material-symbols-rounded">settings</span>
|
||||
</ListItemIcon>
|
||||
Settings
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
onClick={() => {
|
||||
navigate({ to: "/settings/preferences" });
|
||||
|
||||
Reference in new issue
Block a user