refactor: move more files to typescript
This commit is contained in:
20 files changed
+123
-177
No files matched your search
@@ -4,11 +4,11 @@ import { getRuntimeMusic } from "../../utils/date/time";
|
||||
import { useAudioPlayback } from "../../utils/store/audioPlayback";
|
||||
import LikeButton from "../buttons/likeButton";
|
||||
import PlayButton from "../buttons/playButton";
|
||||
import TextLink from "../textLink";
|
||||
import "./musicTrack.scss";
|
||||
import getImageUrlsApi from "@/utils/methods/getImageUrlsApi";
|
||||
import { useApiInContext } from "@/utils/store/api";
|
||||
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
||||
import { Link } from "@tanstack/react-router";
|
||||
import lyrics_icon from "../../assets/icons/lyrics.svg";
|
||||
|
||||
/**
|
||||
@@ -114,18 +114,21 @@ const MusicTrack = ({
|
||||
style={{ display: "inline-flex", alignItems: "center" }}
|
||||
key={artist.Id}
|
||||
>
|
||||
<TextLink
|
||||
variant={"subtitle2"}
|
||||
location={`/artist/${artist.Id}`}
|
||||
otherProps={{
|
||||
fontWeight: 400,
|
||||
style: {
|
||||
textDecoration: "none",
|
||||
},
|
||||
<Typography
|
||||
variant="subtitle2"
|
||||
fontWeight="400"
|
||||
style={{
|
||||
textDecoration: "none",
|
||||
}}
|
||||
>
|
||||
{artist.Name}
|
||||
</TextLink>
|
||||
<Link
|
||||
style={{ textDecoration: "none", color: "white" }}
|
||||
to="/artist/$id"
|
||||
params={{ id: artist.Id ?? "" }}
|
||||
>
|
||||
{artist.Name}
|
||||
</Link>
|
||||
</Typography>
|
||||
{index !== (item.ArtistItems?.length ?? 0) - 1 && (
|
||||
<span
|
||||
style={{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from "react";
|
||||
|
||||
import { Divider, LinearProgress, Skeleton } from "@mui/material";
|
||||
import { Skeleton } from "@mui/material";
|
||||
import { motion } from "framer-motion";
|
||||
|
||||
const ItemSkeleton = () => {
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import Typography from "@mui/material/Typography";
|
||||
|
||||
import "./textLink.scss";
|
||||
import { useNavigate } from "@tanstack/react-router";
|
||||
|
||||
const TextLink = ({ children, location, variant, otherProps }) => {
|
||||
const navigate = useNavigate();
|
||||
|
||||
return (
|
||||
<Typography
|
||||
variant={variant}
|
||||
className="link flex"
|
||||
onClick={() => navigate({ to: location })}
|
||||
{...otherProps}
|
||||
>
|
||||
{children}
|
||||
</Typography>
|
||||
);
|
||||
};
|
||||
|
||||
export default TextLink;
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
.link {
|
||||
text-decoration: underline;
|
||||
text-decoration-color: rgb(255 255 255 / 0.5);
|
||||
white-space: pre-line;
|
||||
width: fit-content;
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
text-decoration-color: rgb(255 255 255 / 1);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user