diff --git a/src/components/card/card.jsx b/src/components/card/card.jsx index ce04a5f..75c9f81 100644 --- a/src/components/card/card.jsx +++ b/src/components/card/card.jsx @@ -2,54 +2,132 @@ import React from "react"; import PropTypes from "prop-types"; +import Box from "@mui/material/Box"; import Card from "@mui/material/Card"; import CardContent from "@mui/material/CardContent"; import CardMedia from "@mui/material/CardMedia"; import CardActionArea from "@mui/material/CardActionArea"; import Typography from "@mui/material/Typography"; +import LinearProgress from "@mui/material/LinearProgress"; import { MediaCollectionTypeIconCollectionCard, MediaTypeIconCollectionCard, } from "../utils/iconsCollection"; +import { borderRadiusDefault } from "../../palette.module.scss"; import "./card.module.scss"; -export const CardLandscape = ({ itemName, itemId, imageTags, iconType }) => { +export const CardLandscape = ({ + itemName, + itemId, + imageTags, + iconType, + cardType = "", + subText = "", + playedPercent, +}) => { return ( - + - {imageTags ? ( - - ) : ( - - {MediaCollectionTypeIconCollectionCard[iconType]} - - )} + + {imageTags ? ( + cardType == "thumb" ? ( + + ) : ( + + ) + ) : ( + + {cardType == "lib" + ? MediaCollectionTypeIconCollectionCard[ + iconType + ] + : MediaTypeIconCollectionCard[iconType]} + + )} + {!!playedPercent && ( + + )} + - + {itemName} + + {subText} + @@ -94,11 +172,14 @@ CardLandscape.propTypes = { itemId: PropTypes.string.isRequired, imageTags: PropTypes.bool, iconType: PropTypes.string.isRequired, + cardType: PropTypes.string, + subText: PropTypes.string || PropTypes.number, + playedPercent: PropTypes.number, }; CardPotrait.propTypes = { itemName: PropTypes.string.isRequired, itemId: PropTypes.string.isRequired, imageTags: PropTypes.bool, - iconType: PropTypes.string.isRequired, + iconType: PropTypes.string, }; diff --git a/src/components/card/card.module.scss b/src/components/card/card.module.scss index ae8e410..1f287dd 100644 --- a/src/components/card/card.module.scss +++ b/src/components/card/card.module.scss @@ -2,6 +2,7 @@ .card { margin-right: 1em; + border-radius: $border-radius-default; &.landscape { --image-aspect-ratio: 1.77; @@ -13,8 +14,7 @@ &-image { position: relative; - z-index: 1; - border-radius: 10px; + border-radius: $border-radius-default; aspect-ratio: var(--image-aspect-ratio); background-size: cover; background-position: center; @@ -33,16 +33,14 @@ width: 100% !important; color: transparent; background: $clr-gradient-dark; - z-index: 0; + border-radius: $border-radius-default; } } } &-text-container { - margin-top: 0.5em; display: flex; flex-direction: column; justify-content: center; align-items: center; - padding: 0 !important; } } diff --git a/src/components/cardScroller/cardScroller.jsx b/src/components/cardScroller/cardScroller.jsx index ba576a6..75e87fc 100644 --- a/src/components/cardScroller/cardScroller.jsx +++ b/src/components/cardScroller/cardScroller.jsx @@ -19,7 +19,7 @@ import "./cardScroller.module.scss"; export const CardScroller = ({ children, displayCards, title }) => { const responsive = { desktop: { - breakpoint: { max: 3000, min: 1024 }, + breakpoint: { max: 3000, min: 1025 }, items: displayCards, slidesToSlide: displayCards, // optional, default to 1. }, diff --git a/src/palette.module.scss b/src/palette.module.scss index b62d772..80d4474 100644 --- a/src/palette.module.scss +++ b/src/palette.module.scss @@ -10,4 +10,6 @@ clrBackgroundDark: $clr-background-dark; clrBackgroundLight: $clr-background-light; + + borderRadiusDefault: $border-radius-default; } diff --git a/src/routes/home/root.jsx b/src/routes/home/root.jsx index 5fbdd82..c30370e 100644 --- a/src/routes/home/root.jsx +++ b/src/routes/home/root.jsx @@ -111,6 +111,7 @@ const Home = () => { userId: user.data.Id, limit: 16, mediaTypes: ["Video"], + enableUserData: true, }, ); return resumeItems.data; @@ -126,6 +127,7 @@ const Home = () => { userId: user.data.Id, limit: 16, mediaTypes: ["Audio"], + enableUserData: true, }, ); return resumeItems.data; @@ -528,6 +530,7 @@ const Home = () => { imageTags={ !!item.ImageTags.Primary } + cardType="lib" iconType={item.CollectionType} > ); @@ -545,14 +548,127 @@ const Home = () => { return ( + ); + }, + )} + + )} + {resumeItemsVideo.isLoading ? ( + + ) : resumeItemsVideo.data.Items.length == 0 ? ( + <> + ) : ( + + {resumeItemsVideo.data.Items.map( + (item, index) => { + return ( + + ); + }, + )} + + )} + {resumeItemsAudio.isLoading ? ( + + ) : resumeItemsAudio.data.Items.length == 0 ? ( + <> + ) : ( + + {resumeItemsAudio.data.Items.map( + (item, index) => { + return ( + ); },