refactor: improve UI components

This commit is contained in:
--remove-section committed 2026-01-17 20:20:20 +05:30
1 parent 79c70e6d46
commit 690070207b
14 files changed
+220 -246

No files matched your search

+7 -9
View File
@@ -1,13 +1,11 @@
import React from "react";
import IconButton from "@mui/material/IconButton";
import { useApiInContext } from "@/utils/store/api";
import type { UserItemDataDto } from "@jellyfin/sdk/lib/generated-client";
import { getUserLibraryApi } from "@jellyfin/sdk/lib/utils/api/user-library-api";
import { pink } from "@mui/material/colors";
import IconButton from "@mui/material/IconButton";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useSnackbar } from "notistack";
import React from "react";
import { useApiInContext } from "@/utils/store/api";
export default function LikeButton({
itemId,
@@ -78,24 +76,24 @@ export default function LikeButton({
transition: "opacity 250ms",
}}
>
<div
<span
className="material-symbols-rounded"
style={
isFavorite
? {
//@ts-ignore
//@ts-expect-error
"--fill": mutation.isPending ? 0 : 1,
color: mutation.isPending ? "white" : pink.A700,
}
: {
//@ts-ignore
//@ts-expect-error
"--fill": mutation.isPending ? 1 : 0,
color: mutation.isPending ? pink.A700 : "white",
}
}
>
favorite
</div>
</span>
</IconButton>
);
}
+6 -6
View File
@@ -263,14 +263,14 @@ const PlayButton = ({
}
{...buttonProps}
>
<div
<span
className="material-symbols-rounded em-4 fill"
style={{
fontSize: "3em",
}}
>
play_arrow
</div>
</span>
</Fab>
);
}
@@ -295,7 +295,7 @@ const PlayButton = ({
}
}}
startIcon={
<div
<span
className="material-symbols-rounded fill"
style={{
zIndex: 1,
@@ -303,7 +303,7 @@ const PlayButton = ({
}}
>
play_arrow
</div>
</span>
}
{...buttonProps}
sx={{
@@ -384,7 +384,7 @@ const PlayButton = ({
item.Type === "Episode" ? handleClick(e, item.Id) : handleClick(e)
}
startIcon={
<div
<span
className="material-symbols-rounded fill"
style={{
zIndex: 1,
@@ -392,7 +392,7 @@ const PlayButton = ({
}}
>
play_arrow
</div>
</span>
}
{...buttonProps}
sx={{
+14 -5
View File
@@ -160,13 +160,21 @@ const QueueButton = () => {
open={open}
onClose={() => setOpen(false)}
PaperProps={{
className: "glass",
sx: {
width: 450,
maxWidth: "100%",
display: "flex",
flexDirection: "column",
bgcolor: "background.default",
backgroundImage: "none",
borderLeft: "1px solid rgba(255, 255, 255, 0.08)",
},
}}
ModalProps={{
BackdropProps: {
sx: {
backgroundColor: "rgba(0, 0, 0, 0.2)",
backdropFilter: "blur(4px)",
},
},
}}
>
@@ -179,9 +187,10 @@ const QueueButton = () => {
position: "sticky",
top: 0,
zIndex: 20,
bgcolor: "background.default",
borderBottom: "1px solid",
borderColor: "divider",
borderColor: "rgba(255, 255, 255, 0.08)",
backgroundColor: "rgba(20, 20, 30, 0.4)",
backdropFilter: "blur(12px)",
}}
>
<Box display="flex" alignItems="center" gap={1}>
@@ -194,7 +203,7 @@ const QueueButton = () => {
sx={{
ml: 1,
fontWeight: 600,
bgcolor: "action.hover",
bgcolor: "rgba(255, 255, 255, 0.08)",
px: 1,
py: 0.5,
borderRadius: 2,
@@ -1,6 +1,3 @@
import useInterval from "@/utils/hooks/useInterval";
import { saveUser } from "@/utils/storage/user";
import { useApiInContext } from "@/utils/store/api";
import { getQuickConnectApi } from "@jellyfin/sdk/lib/utils/api/quick-connect-api";
import { getUserApi } from "@jellyfin/sdk/lib/utils/api/user-api";
import { LoadingButton, type LoadingButtonProps } from "@mui/lab";
@@ -22,6 +19,9 @@ import { useNavigate } from "@tanstack/react-router";
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
import { useSnackbar } from "notistack";
import React, { useCallback, useState } from "react";
import useInterval from "@/utils/hooks/useInterval";
import { saveUser } from "@/utils/storage/user";
import { useApiInContext } from "@/utils/store/api";
const Transition = React.forwardRef(function Transition(
props: TransitionProps & {
@@ -185,6 +185,7 @@ const QuickConnectButton = (props: LoadingButtonProps) => {
fullWidth
maxWidth="xs"
TransitionComponent={Transition}
PaperProps={{ className: "glass", sx: { borderRadius: "24px" } }}
>
<DialogContent
style={{
+1
View File
@@ -23,6 +23,7 @@ const TrailerButton = (props: TrailerButtonType) => {
fullWidth
open={dialog}
PaperProps={{
className: "glass",
style: {
overflow: "hidden",
},