From c9ee2af3e50efd86406417d77f3e0060e76b229c Mon Sep 17 00:00:00 2001 From: Belen Curcio Date: Tue, 20 Oct 2020 14:02:06 -0300 Subject: [PATCH] Changes to productView --- .../ProductView/ProductView.module.css | 54 ++++++++++++++++++- .../product/ProductView/ProductView.tsx | 30 +++++------ 2 files changed, 67 insertions(+), 17 deletions(-) diff --git a/components/product/ProductView/ProductView.module.css b/components/product/ProductView/ProductView.module.css index 252719738..96c48d610 100644 --- a/components/product/ProductView/ProductView.module.css +++ b/components/product/ProductView/ProductView.module.css @@ -1,7 +1,59 @@ +.root { + @apply relative grid items-start my-12 gap-8 grid-cols-1; + + @screen md { + @apply grid-cols-2; + } +} + .button { min-width: 300px; + text-align: center; + + justify-self: center; +} + +.productDisplay { + @apply flex px-0 pb-0 relative box-border min-h-full; + margin-right: -2rem; + margin-left: -2rem; + + min-height: 400px; + + @screen md { + @apply px-24 mx-0; + } +} + +.nameBox { + @apply absolute top-0 left-0 z-50; + + & .name { + @apply px-6 py-2 bg-primary text-primary font-bold text-3xl; + } + + & .price { + @apply px-6 py-2 pb-4 bg-primary text-primary font-bold inline-block tracking-wide; + } + + @screen md { + & .name, + & .price { + @apply bg-violet text-white; + } + } } .squareBg { - @apply absolute inset-24 z-0 bg-violet; + @apply absolute inset-0 bg-violet z-0; + max-height: 250px; + + @screen md { + @apply inset-14; + min-height: 400px; + } +} + +.productSliderContainer { + @apply absolute z-10 inset-0 flex items-center justify-center mt-6; } diff --git a/components/product/ProductView/ProductView.tsx b/components/product/ProductView/ProductView.tsx index 05d90e16d..b6c14728d 100644 --- a/components/product/ProductView/ProductView.tsx +++ b/components/product/ProductView/ProductView.tsx @@ -8,6 +8,7 @@ import useAddItem from '@lib/bigcommerce/cart/use-add-item' import { getProductOptions } from '../helpers' import s from './ProductView.module.css' import { isDesktop } from '@lib/browser' +import cn from 'classnames' interface Props { className?: string children?: any @@ -63,22 +64,21 @@ const ProductView: FC = ({ product, className }) => { ], }} /> -
-
-

- {product.name} -

-
- {product.prices?.price.value} - {` `} - {product.prices?.price.currencyCode} +
+
+
+
+

{product.name}

+
+ {product.prices?.price.value} + {` `} + {product.prices?.price.currencyCode} +
-
-
-
+
- {/** TODO: Change with Image Component */} + {/** TODO: Change with Image Component **/} {product.images.edges?.map((image, i) => ( = ({ product, className }) => {
)} - -
-
+
{options?.map((opt: any) => (