Skip to content

Commit c9e32de

Browse files
committed
feat: Added missing tabs to metascreen
1 parent 2370766 commit c9e32de

File tree

1 file changed

+178
-5
lines changed

1 file changed

+178
-5
lines changed

frontend/src/components/MetaScreen.tsx

Lines changed: 178 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ function MetaScreen() {
213213
justifyContent: "flex-start",
214214
backgroundColor: "#181818",
215215
mt: 4,
216-
pb: 4,
216+
pb: "20vh",
217217

218218
borderTopLeftRadius: "10px",
219219
borderTopRightRadius: "10px",
@@ -613,10 +613,9 @@ function MetaScreen() {
613613
}}
614614
onClick={() => {
615615
if (!data) return;
616-
if(WatchList.isOnWatchList(data?.guid as string))
616+
if (WatchList.isOnWatchList(data?.guid as string))
617617
WatchList.removeItem(data?.guid as string);
618-
else
619-
WatchList.addItem(data);
618+
else WatchList.addItem(data);
620619
}}
621620
>
622621
{WatchList.isOnWatchList(data?.guid as string) ? (
@@ -741,7 +740,7 @@ function MetaScreen() {
741740
cursor: "zoom-in",
742741
}}
743742
onClick={() => {
744-
if(!data?.summary) return;
743+
if (!data?.summary) return;
745744
useBigReader.getState().setBigReader(data?.summary);
746745
}}
747746
>
@@ -826,6 +825,8 @@ function MetaScreen() {
826825
<Divider sx={{ mb: 2, width: "100%" }} />
827826

828827
{page === 0 && MetaPage1(data, similar, episodes, navigate)}
828+
{page === 1 && MetaPage2(data)}
829+
{page === 2 && MetaPage3(data)}
829830
</Box>
830831
</Box>
831832
</Backdrop>
@@ -913,6 +914,178 @@ function MetaPage1(
913914
);
914915
}
915916

917+
function MetaPage2(data: Plex.Metadata | undefined) {
918+
if (!data) return <></>;
919+
if (data.Related?.Hub?.length === 0) return <>Nothing here</>;
920+
921+
return (
922+
<Box
923+
sx={{
924+
width: "100%",
925+
display: "flex",
926+
flexDirection: "column",
927+
alignItems: "flex-start",
928+
justifyContent: "flex-start",
929+
gap: "60px",
930+
}}
931+
>
932+
{data.Related?.Hub?.map((hub) => (
933+
<Box
934+
sx={{
935+
width: "100%",
936+
display: "flex",
937+
flexDirection: "column",
938+
alignItems: "flex-start",
939+
justifyContent: "flex-start",
940+
gap: 1,
941+
}}
942+
>
943+
<Typography
944+
sx={{
945+
fontSize: "1.5rem",
946+
fontWeight: "bold",
947+
color: "#FFFFFF",
948+
textShadow: "0px 0px 10px #000000",
949+
}}
950+
>
951+
{hub.title}
952+
</Typography>
953+
954+
<Grid container spacing={2}>
955+
{hub.Metadata?.map((item) => (
956+
<Grid item lg={3} md={4} sm={6} xs={12}>
957+
<MovieItem item={item} />
958+
</Grid>
959+
))}
960+
</Grid>
961+
</Box>
962+
))}
963+
</Box>
964+
);
965+
}
966+
967+
function MetaPage3(data: Plex.Metadata | undefined) {
968+
return (
969+
<Box
970+
sx={{
971+
width: "100%",
972+
display: "flex",
973+
flexDirection: "column",
974+
alignItems: "flex-start",
975+
justifyContent: "flex-start",
976+
gap: "60px",
977+
}}
978+
>
979+
<Box
980+
sx={{
981+
width: "100%",
982+
display: "flex",
983+
flexDirection: "column",
984+
alignItems: "flex-start",
985+
justifyContent: "flex-start",
986+
gap: 1,
987+
}}
988+
>
989+
<Typography
990+
sx={{
991+
fontSize: "1.5rem",
992+
fontWeight: "bold",
993+
color: "#FFFFFF",
994+
textShadow: "0px 0px 10px #000000",
995+
}}
996+
>
997+
Cast
998+
</Typography>
999+
1000+
<Grid container spacing={2}>
1001+
{data?.Role?.map((role) => (
1002+
<Grid item xl={3} lg={4} md={6} sm={6} xs={6}>
1003+
<Link
1004+
to={`/library/${data?.librarySectionID}/dir/actor/${role.id}`}
1005+
>
1006+
<Box
1007+
sx={{
1008+
width: "100%",
1009+
display: "flex",
1010+
flexDirection: "row",
1011+
alignItems: "center",
1012+
justifyContent: "flex-start",
1013+
gap: "20px",
1014+
backgroundColor: "#00000055",
1015+
padding: "10px 20px",
1016+
borderRadius: "10px",
1017+
1018+
userSelect: "none",
1019+
cursor: "pointer",
1020+
1021+
"&:hover": {
1022+
backgroundColor: "#00000088",
1023+
transition: "all 0.2s ease",
1024+
},
1025+
1026+
transition: "all 0.5s ease",
1027+
}}
1028+
>
1029+
<Avatar
1030+
src={`${getTranscodeImageURL(
1031+
`${role.thumb}?X-Plex-Token=${localStorage.getItem(
1032+
"accessToken"
1033+
)}`,
1034+
200,
1035+
200
1036+
)}`}
1037+
sx={{
1038+
width: "25%",
1039+
height: "auto",
1040+
aspectRatio: "1/1",
1041+
borderRadius: "50%",
1042+
}}
1043+
/>
1044+
1045+
<Box
1046+
sx={{
1047+
width: "75%",
1048+
display: "flex",
1049+
flexDirection: "column",
1050+
alignItems: "flex-start",
1051+
overflow: "hidden",
1052+
}}
1053+
>
1054+
<Typography
1055+
sx={{
1056+
fontSize: "1rem",
1057+
color: "#FFFFFF",
1058+
}}
1059+
>
1060+
{role.tag}
1061+
</Typography>
1062+
<Typography
1063+
sx={{
1064+
fontSize: "0.75rem",
1065+
color: "#BBBBBB",
1066+
1067+
overflow: "hidden",
1068+
textOverflow: "ellipsis",
1069+
display: "-webkit-box",
1070+
WebkitLineClamp: 1,
1071+
whiteSpace: "nowrap",
1072+
1073+
width: "100%",
1074+
}}
1075+
>
1076+
{role.role}
1077+
</Typography>
1078+
</Box>
1079+
</Box>
1080+
</Link>
1081+
</Grid>
1082+
))}
1083+
</Grid>
1084+
</Box>
1085+
</Box>
1086+
);
1087+
}
1088+
9161089
function EpisodeItem({
9171090
item,
9181091
onClick,

0 commit comments

Comments
 (0)