From 275a05a0a36c6eec2fe857fa3143f5c80d2f35e0 Mon Sep 17 00:00:00 2001 From: prayag17 Date: Mon, 20 Mar 2023 09:24:00 +0530 Subject: [PATCH] Update CardLandscape --- src/components/card/card.jsx | 40 +++++++------------- src/components/card/card.module.scss | 11 ++---- src/components/cardScroller/cardScroller.jsx | 2 +- 3 files changed, 17 insertions(+), 36 deletions(-) diff --git a/src/components/card/card.jsx b/src/components/card/card.jsx index 8ce36be..b85554d 100644 --- a/src/components/card/card.jsx +++ b/src/components/card/card.jsx @@ -16,17 +16,8 @@ import { import "./card.module.scss"; export const CardLandscape = ({ itemName, itemId, imageTags, iconType }) => { - const imageAvailable = () => { - if (imageTags == {}) { - return false; - } else { - console.log("hee"); - return true; - } - }; - console.log(!!imageTags.Primary); return ( - + {imageTags ? ( { itemId + "/Images/Primary" } - // alt={MediaCollectionTypeIconCollectionCard[iconType]} alt={itemName} className="card-image-container" > ) : ( - + {MediaCollectionTypeIconCollectionCard[iconType]} )} -
- + + {itemName} -
+
); }; export const CardPotrait = ({ itemName, itemId, imageTags, iconType }) => { - const imageAvailable = () => { - console.log(imageTags); - if (imageTags == undefined) { - console.log("hee"); - return false; - } else { - return true; - } - }; return (
- {imageAvailable ? ( + {imageTags ? (
{ CardLandscape.propTypes = { itemName: PropTypes.string.isRequired, itemId: PropTypes.string.isRequired, - imageTags: PropTypes.object, + imageTags: PropTypes.bool, iconType: PropTypes.string.isRequired, }; CardPotrait.propTypes = { itemName: PropTypes.string.isRequired, itemId: PropTypes.string.isRequired, - imageTags: PropTypes.object, + imageTags: PropTypes.bool, iconType: PropTypes.string.isRequired, }; diff --git a/src/components/card/card.module.scss b/src/components/card/card.module.scss index 51831c6..af4a74d 100644 --- a/src/components/card/card.module.scss +++ b/src/components/card/card.module.scss @@ -25,17 +25,11 @@ font-size: 4.5em !important; &-container { - display: flex; + display: flex !important; + aspect-ratio: 1.777; justify-content: center; align-items: center; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; width: 100% !important; - height: 100% !important; - border-radius: $border-radius-default; color: $clr-accent-default; background: $clr-accent-dark; z-index: 0; @@ -48,5 +42,6 @@ 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 f8f53dd..ba576a6 100644 --- a/src/components/cardScroller/cardScroller.jsx +++ b/src/components/cardScroller/cardScroller.jsx @@ -38,7 +38,7 @@ export const CardScroller = ({ children, displayCards, title }) => { const [carouselRef, setCarouselRef] = useState(); return ( - +