From 42784946d0a2ee18b7e2977fbd9cd05248cc596b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cain=C3=A3=20Milech?= Date: Sun, 29 Jan 2023 23:09:01 -0300 Subject: [PATCH] feat(pdp): Adiciona placeholder cep --- react/components/Html/styles.css | 2 +- react/components/Pix/Pix.module.css | 26 ++++++++++++++++++- react/components/Pix/Pix.tsx | 14 +++++++--- store/blocks/pdp/product.jsonc | 2 +- styles/css/vtex.bread-crumb.css | 12 --------- styles/css/vtex.slider-layout.css | 19 ++++++++++++++ styles/css/vtex.store-components.css | 6 +++++ .../pages/product/vtex.slider-layout.scss | 24 +++++++++++++++++ .../pages/product/vtex.store-components.scss | 7 +++++ 9 files changed, 94 insertions(+), 18 deletions(-) delete mode 100644 styles/css/vtex.bread-crumb.css diff --git a/react/components/Html/styles.css b/react/components/Html/styles.css index 1dbea08..fcb9543 100644 --- a/react/components/Html/styles.css +++ b/react/components/Html/styles.css @@ -13,7 +13,7 @@ } [class*="html--image-container"] { - width: 50.18%; + width: 49.82%; } [class*="html--qtd-btn"] { diff --git a/react/components/Pix/Pix.module.css b/react/components/Pix/Pix.module.css index 83743cd..b91551c 100644 --- a/react/components/Pix/Pix.module.css +++ b/react/components/Pix/Pix.module.css @@ -1,3 +1,27 @@ .containerPix { - background-color: red; + display: flex; + gap: 26px; + align-items: center; + margin-top: 8px; +} + +.image { + width: 66px; + height: 24px; +} + +.price { + margin: 0; + font-weight: 700; + font-size: 18px; + line-height: 25px; + color: rgba(0, 0, 0, 0.58); +} + +.discount { + margin: 0; + font-weight: 300; + font-size: 13px; + line-height: 18px; + color: #929292; } diff --git a/react/components/Pix/Pix.tsx b/react/components/Pix/Pix.tsx index c1483dc..fa4ef0d 100644 --- a/react/components/Pix/Pix.tsx +++ b/react/components/Pix/Pix.tsx @@ -3,18 +3,26 @@ import { useProduct } from "vtex.product-context"; import styles from "./Pix.module.css"; const Pix = () => { + if (typeof document !== undefined) { + const input = document.querySelector(".vtex-address-form-4-x-input"); + input?.setAttribute("placeholder", "Digite seu CEP"); + } + const price = useProduct()?.product?.priceRange?.sellingPrice?.highPrice; const discount = (Number(price) * 10) / 100; const priceWithDiscount = Number(price) - Number(discount); return (
Imagem do pix -
-

R$ {priceWithDiscount.toFixed(2)}

-

10 % de desconto

+
+

+ R$ {priceWithDiscount.toFixed(2).replace(".", ",")} +

+

10 % de desconto

); diff --git a/store/blocks/pdp/product.jsonc b/store/blocks/pdp/product.jsonc index a65b8c6..32a9a9c 100644 --- a/store/blocks/pdp/product.jsonc +++ b/store/blocks/pdp/product.jsonc @@ -45,7 +45,7 @@ "phone": 1 }, "infinite": true, - "fullWidth": false, + /*"fullWidth": false,*/ "blockClass": "prateleira" } }, diff --git a/styles/css/vtex.bread-crumb.css b/styles/css/vtex.bread-crumb.css deleted file mode 100644 index d44d04c..0000000 --- a/styles/css/vtex.bread-crumb.css +++ /dev/null @@ -1,12 +0,0 @@ -/* -0 - 600PX: Phone -600 - 900px: Table portrait -900 - 1200px: Tablet landscape -[1200 - 1800] is where our nortal styles apply -1800px + : Big desktop -*/ -/* Media Query M3 */ -/* Grid breakpoints */ -.html--pdp-breadcrumb { - border: 1px solid red; -} \ No newline at end of file diff --git a/styles/css/vtex.slider-layout.css b/styles/css/vtex.slider-layout.css index 46fc61f..3c4bc25 100644 --- a/styles/css/vtex.slider-layout.css +++ b/styles/css/vtex.slider-layout.css @@ -7,6 +7,15 @@ */ /* Media Query M3 */ /* Grid breakpoints */ +.sliderLayoutContainer--prateleira { + padding-left: 40px; + padding-right: 40px; + justify-content: center; +} +.sliderLayoutContainer--prateleira .sliderTrackContainer--prateleira { + width: 97.1773%; +} + .paginationDotsContainer--prateleira { align-items: center; } @@ -30,4 +39,14 @@ .sliderArrows--prateleira { margin: 14px; +} + +.sliderLayoutContainer :global(.vtex-product-summary-2-x-containerNormal) { + max-width: unset !important; +} +.sliderLayoutContainer :global(.vtex-product-summary-2-x-imageNormal) { + max-height: unset !important; +} +.sliderLayoutContainer :global(.vtex-product-summary-2-x-imageStackContainer) { + display: flex; } \ No newline at end of file diff --git a/styles/css/vtex.store-components.css b/styles/css/vtex.store-components.css index 5eee30b..62158b1 100644 --- a/styles/css/vtex.store-components.css +++ b/styles/css/vtex.store-components.css @@ -195,6 +195,12 @@ .shippingContainer :global(.vtex-input-prefix__group) :global(.vtex-address-form-4-x-hideDecorators) { width: 231px; } +.shippingContainer :global(.vtex-input-prefix__group) :global(.vtex-address-form-4-x-hideDecorators)::placeholder { + font-weight: 400; + font-size: 12px; + line-height: 16px; + color: #afafaf; +} .shippingContainer :global(.vtex-address-form__postalCode-forgottenURL) { position: absolute; top: 28px; diff --git a/styles/sass/pages/product/vtex.slider-layout.scss b/styles/sass/pages/product/vtex.slider-layout.scss index 227b96d..6ee42df 100644 --- a/styles/sass/pages/product/vtex.slider-layout.scss +++ b/styles/sass/pages/product/vtex.slider-layout.scss @@ -1,3 +1,13 @@ +.sliderLayoutContainer--prateleira { + padding-left: 40px; + padding-right: 40px; + justify-content: center; + + .sliderTrackContainer--prateleira { + width: 97.1773%; + } +} + //DOTS .paginationDotsContainer--prateleira { @@ -27,3 +37,17 @@ .sliderArrows--prateleira { margin: 14px; } + +.sliderLayoutContainer { + :global(.vtex-product-summary-2-x-containerNormal) { + max-width: unset !important; + } + + :global(.vtex-product-summary-2-x-imageNormal) { + max-height: unset !important; + } + + :global(.vtex-product-summary-2-x-imageStackContainer) { + display: flex; + } +} diff --git a/styles/sass/pages/product/vtex.store-components.scss b/styles/sass/pages/product/vtex.store-components.scss index 3918050..c161231 100644 --- a/styles/sass/pages/product/vtex.store-components.scss +++ b/styles/sass/pages/product/vtex.store-components.scss @@ -217,6 +217,13 @@ :global(.vtex-address-form-4-x-hideDecorators) { width: 231px; + + &::placeholder { + font-weight: 400; + font-size: 12px; + line-height: 16px; + color: #afafaf; + } } }