feat: add new album page
This commit is contained in:
13 files changed
+413
-354
No files matched your search
@@ -85,7 +85,7 @@ export const AppBar = () => {
|
||||
const usr = await getUserApi(api).getCurrentUser();
|
||||
return usr.data;
|
||||
},
|
||||
enabled: display && Boolean(api.accessToken),
|
||||
enabled: display && Boolean(api?.accessToken),
|
||||
throwOnError: true,
|
||||
});
|
||||
const libraries = useQuery({
|
||||
|
||||
@@ -400,7 +400,7 @@ const PlayButton = ({
|
||||
color="white"
|
||||
size={size}
|
||||
>
|
||||
{itemUserData.PlaybackPositionTicks
|
||||
{itemUserData?.PlaybackPositionTicks
|
||||
? "Continue Watching"
|
||||
: item?.Type === "MusicAlbum" ||
|
||||
item?.Type === "Audio" ||
|
||||
@@ -412,8 +412,8 @@ const PlayButton = ({
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
value={
|
||||
100 > itemUserData.PlayedPercentage > 0
|
||||
? itemUserData.PlayedPercentage
|
||||
100 > itemUserData?.PlayedPercentage > 0
|
||||
? itemUserData?.PlayedPercentage
|
||||
: 0
|
||||
}
|
||||
sx={{
|
||||
@@ -431,7 +431,7 @@ const PlayButton = ({
|
||||
color="white"
|
||||
/>
|
||||
</Button>
|
||||
{itemUserData.PlaybackPositionTicks > 0 && (
|
||||
{itemUserData?.PlaybackPositionTicks > 0 && (
|
||||
<Typography
|
||||
sx={{
|
||||
opacity: 0.8,
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Typography } from "@mui/material";
|
||||
import { Link, type LinkProps } from "@tanstack/react-router";
|
||||
import React from "react";
|
||||
|
||||
import "./tagChip.scss";
|
||||
|
||||
const TagChip = ({
|
||||
label,
|
||||
linkProps,
|
||||
}: { label: string; linkProps: LinkProps }) => {
|
||||
return (
|
||||
<Link className="tag" {...linkProps}>
|
||||
<Typography variant="subtitle2" fontWeight={300}>
|
||||
{label}
|
||||
</Typography>
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
|
||||
export default TagChip;
|
||||
@@ -0,0 +1,19 @@
|
||||
.tag {
|
||||
display: flex;
|
||||
padding: 0.4em 0.8em;
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
gap: 0.2em;
|
||||
border: 1px solid rgb(255 255 255 / 0.3);
|
||||
border-radius: 4em;
|
||||
.MuiTypography-root {
|
||||
white-space: nowrap;
|
||||
transition: $transition-time-fast;
|
||||
}
|
||||
&:hover {
|
||||
border-color: rgb(255 255 255 / 0.8) !important;
|
||||
.MuiTypography-root {
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import { BaseItemKind } from "@jellyfin/sdk/lib/generated-client";
|
||||
import React from "react";
|
||||
|
||||
export const getTypeIcon = (icon) => {
|
||||
export const getTypeIcon = (icon: BaseItemKind) => {
|
||||
switch (icon) {
|
||||
case "Home":
|
||||
return <div className="material-symbols-rounded">home</div>;
|
||||
Reference in new issue
Block a user