From 341473991352e0217db53e5df3fce588e2a211c7 Mon Sep 17 00:00:00 2001 From: Bel Curcio Date: Tue, 1 Jun 2021 17:06:03 -0300 Subject: [PATCH] New tailwind required changes --- .../product/ProductCard/ProductCard.tsx | 27 +++--- .../ProductView/ProductView.module.css | 97 +++++++++---------- .../product/ProductView/ProductView.tsx | 2 + 3 files changed, 65 insertions(+), 61 deletions(-) diff --git a/components/product/ProductCard/ProductCard.tsx b/components/product/ProductCard/ProductCard.tsx index b0d0f838c..524e6beae 100644 --- a/components/product/ProductCard/ProductCard.tsx +++ b/components/product/ProductCard/ProductCard.tsx @@ -11,6 +11,7 @@ interface Props { product: Product variant?: 'default' | 'slim' | 'simple' imgProps?: Omit + noNameTag?: boolean } const placeholderImg = '/product-img-placeholder.svg' @@ -18,8 +19,9 @@ const placeholderImg = '/product-img-placeholder.svg' const ProductCard: FC = ({ className, product, - variant = 'default', imgProps, + variant = 'default', + noNameTag = false, ...props }) => ( @@ -62,17 +64,20 @@ const ProductCard: FC = ({ variant={product.variants[0] as any} /> )} +
-
-

- {product.name} -

- - {product.price.value} -   - {product.price.currencyCode} - -
+ {!noNameTag && ( +
+

+ {product.name} +

+ + {product.price.value} +   + {product.price.currencyCode} + +
+ )}
{product?.images && ( diff --git a/components/product/ProductView/ProductView.module.css b/components/product/ProductView/ProductView.module.css index 21f4cdad9..e9068a932 100644 --- a/components/product/ProductView/ProductView.module.css +++ b/components/product/ProductView/ProductView.module.css @@ -1,69 +1,37 @@ .root { @apply relative grid items-start gap-1 grid-cols-1 overflow-x-hidden; - - @screen lg { - @apply grid-cols-12; - } } .main { @apply relative px-0 pb-0 box-border flex flex-col col-span-1; min-height: 600px; - - @screen md { - min-height: 700px; - } - - @screen lg { - @apply mx-0 col-span-8; - } } .nameBox { @apply absolute top-0 left-0 z-20 pr-16; +} - @screen lg { - @apply left-0 pr-16; - } +.nameBox .name { + @apply px-6 py-2 bg-primary text-primary font-bold; + font-size: 1.8rem; + letter-spacing: 0.4px; +} - & .name { - @apply px-6 py-2 bg-primary text-primary font-bold; - font-size: 1.8rem; - letter-spacing: 0.4px; - } - - & .price { - @apply px-6 py-2 pb-4 bg-primary text-primary font-bold inline-block tracking-wide; - } - - @screen lg { - & .name, - & .price { - @apply bg-accent-0 text-accent-9; - } - } +.nameBox .price { + @apply px-6 py-2 pb-4 bg-primary text-primary font-bold inline-block tracking-wide; } .sidebar { @apply flex flex-col col-span-1 mx-auto max-w-8xl px-6 w-full h-full; - - @screen lg { - @apply col-span-4 py-12; - } } .sliderContainer { @apply flex items-center justify-center overflow-x-hidden bg-violet; } -.imageContainer { - @apply text-center; - & > div { - @apply h-full; - & > div { - @apply h-full; - } - } +.imageContainer > div, +.imageContainer > div > div { + @apply h-full; } .sliderContainer .img { @@ -71,15 +39,44 @@ } .button { - text-align: center; - width: 100%; - max-width: 300px; - - @screen sm { - min-width: 300px; - } + min-width: 300px; } .wishlistButton { @apply absolute z-30 top-0 right-0; } + +@screen md { + .main { + min-height: 700px; + } + + .button { + text-align: center; + width: 100%; + max-width: 300px; + } +} + +@screen lg { + .root { + @apply grid-cols-12; + } + + .main { + @apply mx-0 col-span-8; + } + + .nameBox { + @apply left-0 pr-16; + } + + .nameBox .name, + .nameBox .price { + @apply bg-accent-0 text-accent-9; + } + + .sidebar { + @apply col-span-4 py-12; + } +} diff --git a/components/product/ProductView/ProductView.tsx b/components/product/ProductView/ProductView.tsx index d8e72fec2..f7f0d9d69 100644 --- a/components/product/ProductView/ProductView.tsx +++ b/components/product/ProductView/ProductView.tsx @@ -185,9 +185,11 @@ const ProductView: FC = ({ product, relatedProducts }) => { >