Update Icons in item page #243
This commit is contained in:
1 file changed
+18
-26
+18
-26
@@ -1,5 +1,5 @@
|
|||||||
/** @format */
|
/** @format */
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect, useLayoutEffect } from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
|
||||||
import Box from "@mui/material/Box";
|
import Box from "@mui/material/Box";
|
||||||
@@ -168,7 +168,7 @@ const ItemDetail = () => {
|
|||||||
const [selectedAudioTrack, setSelectedAudioTrack] = useState(null);
|
const [selectedAudioTrack, setSelectedAudioTrack] = useState(null);
|
||||||
const [selectedSubtitleTrack, setSelectedSubtitleTrack] = useState(null);
|
const [selectedSubtitleTrack, setSelectedSubtitleTrack] = useState(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (item.isSuccess && !!item.data.MediaStreams) {
|
if (item.isSuccess && !!item.data.MediaStreams) {
|
||||||
let videos = item.data.MediaStreams.filter(
|
let videos = item.data.MediaStreams.filter(
|
||||||
filterMediaStreamVideo,
|
filterMediaStreamVideo,
|
||||||
@@ -196,7 +196,7 @@ const ItemDetail = () => {
|
|||||||
const [writers, setWriters] = useState([]);
|
const [writers, setWriters] = useState([]);
|
||||||
const [actors, setActors] = useState([]);
|
const [actors, setActors] = useState([]);
|
||||||
const [producers, setProducers] = useState([]);
|
const [producers, setProducers] = useState([]);
|
||||||
useEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (item.isSuccess) {
|
if (item.isSuccess) {
|
||||||
setAppBackdrop(
|
setAppBackdrop(
|
||||||
item.data.Type === BaseItemKind.MusicAlbum ||
|
item.data.Type === BaseItemKind.MusicAlbum ||
|
||||||
@@ -231,16 +231,16 @@ const ItemDetail = () => {
|
|||||||
) ||
|
) ||
|
||||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("4k")
|
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("4k")
|
||||||
) {
|
) {
|
||||||
return "4K";
|
return <span className="material-symbols-rounded">4k</span>;
|
||||||
} else if (
|
} else if (
|
||||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||||
"1080p",
|
"1080p",
|
||||||
) ||
|
) ||
|
||||||
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("hd")
|
videoTracks[0]?.DisplayTitle.toLocaleLowerCase().includes("hd")
|
||||||
) {
|
) {
|
||||||
return "HD";
|
return <span className="material-symbols-rounded">full_hd</span>;
|
||||||
} else {
|
} else {
|
||||||
return "SD";
|
return <span className="material-symbols-rounded">hd</span>;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ const ItemDetail = () => {
|
|||||||
"truehd",
|
"truehd",
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return "TrueHD | Atmos";
|
return `TrueHD | Atmos`;
|
||||||
} else if (
|
} else if (
|
||||||
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
audioTracks[0]?.DisplayTitle.toLocaleLowerCase().includes(
|
||||||
"atmos",
|
"atmos",
|
||||||
@@ -404,15 +404,7 @@ const ItemDetail = () => {
|
|||||||
{!!qualityLabel() && (
|
{!!qualityLabel() && (
|
||||||
<Chip
|
<Chip
|
||||||
variant="filled"
|
variant="filled"
|
||||||
label={
|
label={qualityLabel()}
|
||||||
<Typography
|
|
||||||
variant="caption"
|
|
||||||
fontWeight={600}
|
|
||||||
// fontFamily="JetBrains Mono Variable"
|
|
||||||
>
|
|
||||||
{qualityLabel()}
|
|
||||||
</Typography>
|
|
||||||
}
|
|
||||||
sx={{
|
sx={{
|
||||||
borderRadius:
|
borderRadius:
|
||||||
"8px !important",
|
"8px !important",
|
||||||
@@ -429,7 +421,6 @@ const ItemDetail = () => {
|
|||||||
<Typography
|
<Typography
|
||||||
variant="caption"
|
variant="caption"
|
||||||
fontWeight={600}
|
fontWeight={600}
|
||||||
fontFamily="JetBrains Mono Variable"
|
|
||||||
>
|
>
|
||||||
{surroundSoundLabel()}
|
{surroundSoundLabel()}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -450,7 +441,6 @@ const ItemDetail = () => {
|
|||||||
<Typography
|
<Typography
|
||||||
variant="caption"
|
variant="caption"
|
||||||
fontWeight={600}
|
fontWeight={600}
|
||||||
fontFamily="JetBrains Mono Variable"
|
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
videoTracks[0]
|
videoTracks[0]
|
||||||
@@ -474,7 +464,6 @@ const ItemDetail = () => {
|
|||||||
<Typography
|
<Typography
|
||||||
variant="caption"
|
variant="caption"
|
||||||
fontWeight={600}
|
fontWeight={600}
|
||||||
fontFamily="JetBrains Mono Variable"
|
|
||||||
>
|
>
|
||||||
{atmosLabel()}
|
{atmosLabel()}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -492,13 +481,16 @@ const ItemDetail = () => {
|
|||||||
<Chip
|
<Chip
|
||||||
variant="filled"
|
variant="filled"
|
||||||
label={
|
label={
|
||||||
<Typography
|
// <Typography
|
||||||
variant="caption"
|
// variant="caption"
|
||||||
fontWeight={600}
|
// fontWeight={600}
|
||||||
fontFamily="JetBrains Mono Variable"
|
// fontFamily="JetBrains Mono Variable"
|
||||||
>
|
// >
|
||||||
CC
|
// CC
|
||||||
</Typography>
|
// </Typography>
|
||||||
|
<span className="material-symbols-rounded">
|
||||||
|
closed_caption
|
||||||
|
</span>
|
||||||
}
|
}
|
||||||
sx={{
|
sx={{
|
||||||
borderRadius:
|
borderRadius:
|
||||||
|
|||||||
Reference in new issue
Block a user