Add more icons and fix icons types in cards
This commit is contained in:
11 files changed
+178
-33
No files matched your search
@@ -12,7 +12,7 @@ import LinearProgress from "@mui/material/LinearProgress";
|
||||
|
||||
import {
|
||||
MediaCollectionTypeIconCollectionCard,
|
||||
MediaTypeIconCollectionCard,
|
||||
TypeIconCollectionCard,
|
||||
} from "../utils/iconsCollection";
|
||||
|
||||
import { borderRadiusDefault } from "../../palette.module.scss";
|
||||
@@ -43,12 +43,19 @@ export const Card = ({
|
||||
<CardActionArea>
|
||||
<Box
|
||||
className="card-media-container"
|
||||
sx={{ position: "relative", m: 1 }}
|
||||
sx={{
|
||||
position: "relative",
|
||||
m: 1,
|
||||
aspectRatio:
|
||||
cardOrientation == "landscape"
|
||||
? "1.777"
|
||||
: "0.666",
|
||||
}}
|
||||
>
|
||||
{imageTags ? (
|
||||
cardType == "thumb" ? (
|
||||
{imageTags &&
|
||||
(cardType == "thumb" ? (
|
||||
<CardMedia
|
||||
component="img"
|
||||
component="div"
|
||||
image={
|
||||
window.api.basePath +
|
||||
"/Items/" +
|
||||
@@ -67,7 +74,7 @@ export const Card = ({
|
||||
></CardMedia>
|
||||
) : (
|
||||
<CardMedia
|
||||
component="img"
|
||||
component="div"
|
||||
image={
|
||||
window.api.basePath +
|
||||
"/Items/" +
|
||||
@@ -84,16 +91,14 @@ export const Card = ({
|
||||
}}
|
||||
className="card-image"
|
||||
></CardMedia>
|
||||
)
|
||||
) : (
|
||||
<CardMedia className="card-image-icon-container">
|
||||
{cardType == "lib"
|
||||
? MediaCollectionTypeIconCollectionCard[
|
||||
iconType
|
||||
]
|
||||
: MediaTypeIconCollectionCard[iconType]}
|
||||
</CardMedia>
|
||||
)}
|
||||
))}
|
||||
<div className="card-image-icon-container">
|
||||
{cardType == "lib"
|
||||
? MediaCollectionTypeIconCollectionCard[
|
||||
iconType
|
||||
]
|
||||
: TypeIconCollectionCard[iconType]}
|
||||
</div>
|
||||
{!!playedPercent && (
|
||||
<LinearProgress
|
||||
variant="determinate"
|
||||
@@ -123,7 +128,10 @@ export const Card = ({
|
||||
component="div"
|
||||
color="white"
|
||||
fontWeight={500}
|
||||
textAlign="center"
|
||||
textAlign="left"
|
||||
noWrap
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
>
|
||||
{itemName}
|
||||
</Typography>
|
||||
@@ -132,9 +140,12 @@ export const Card = ({
|
||||
variant="subtitle2"
|
||||
component="div"
|
||||
color="gray"
|
||||
textAlign="center"
|
||||
textAlign="left"
|
||||
// textOverflow={}
|
||||
// fontSize="0.85em"
|
||||
width="fit-content"
|
||||
maxWidth="100%"
|
||||
noWrap
|
||||
>
|
||||
{subText}
|
||||
</Typography>
|
||||
@@ -150,7 +161,7 @@ Card.propTypes = {
|
||||
imageTags: PropTypes.bool,
|
||||
iconType: PropTypes.string.isRequired,
|
||||
cardType: PropTypes.string,
|
||||
subText: PropTypes.string || PropTypes.number,
|
||||
subText: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
playedPercent: PropTypes.number,
|
||||
cardOrientation: PropTypes.string.isRequired,
|
||||
};
|
||||
@@ -2,19 +2,9 @@
|
||||
|
||||
.card {
|
||||
border-radius: $border-radius-default;
|
||||
|
||||
&.landscape {
|
||||
--image-aspect-ratio: 1.77;
|
||||
}
|
||||
|
||||
&.portrait {
|
||||
--image-aspect-ratio: 0.65;
|
||||
}
|
||||
|
||||
&-image {
|
||||
position: relative;
|
||||
border-radius: $border-radius-default;
|
||||
aspect-ratio: var(--image-aspect-ratio);
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
&-container {
|
||||
@@ -32,7 +22,12 @@
|
||||
width: 100% !important;
|
||||
color: transparent;
|
||||
background: $clr-gradient-dark;
|
||||
border-radius: $border-radius-default;
|
||||
border-radius: 10px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
height: 100%;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user