From 741b36d69d2fa63cecc5486c4f480e6467255f0d Mon Sep 17 00:00:00 2001 From: Leonardo Date: Wed, 8 Feb 2023 16:26:33 -0300 Subject: [PATCH] feat: adiciona o placeholder --- react/components/Html/styles.css | 41 +++++++++++++++++++ .../ProductContext/ProductContext.tsx | 22 +++++++--- store/blocks/pdp/product.jsonc | 4 +- styles/css/vtex.condition-layout.css | 11 +++++ styles/css/vtex.flex-layout.css | 7 ++++ styles/css/vtex.product-identifier.css | 1 - 6 files changed, 77 insertions(+), 9 deletions(-) diff --git a/react/components/Html/styles.css b/react/components/Html/styles.css index 03d3f6a..28f23ff 100644 --- a/react/components/Html/styles.css +++ b/react/components/Html/styles.css @@ -414,6 +414,7 @@ text-align: center; text-decoration-line: line-through; } + [class*="vtex-slider-layout-0-x-slide--shelf "] :global(.vtex-store-components-3-x-installmentsPrice) { font-size: 0; @@ -439,3 +440,43 @@ text-align: center; color: #575757; } + +[class*="subscriberContainer"] :global(.vtex-store-components-3-x-title) { + font-size: 0; +} + +[class*="subscriberContainer"] + :global(.vtex-store-components-3-x-title)::after { + content: "Produto Indisponível"; + font-family: "Open Sans"; + font-style: normal; + font-weight: 700; + font-size: 16px; + line-height: 19px; + display: flex; + align-items: center; + font-weight: bold; + color: #868686; +} +[class*="subscriberContainer"] + :global(.vtex-store-components-3-x-subscribeLabel) { + font-size: 0; +} +[class*="subscriberContainer"] + :global(.vtex-store-components-3-x-subscribeLabel)::after { + content: "Deseja saber quando estiver disponível?"; + font-family: "Open Sans"; + font-style: normal; + font-weight: 700; + font-size: 14px; + line-height: 19px; + display: flex; + align-items: center; + color: #868686; +} + +[class*="container--home"] { + width: 94.44%; + margin-right: auto; + margin-left: auto; +} diff --git a/react/components/ProductContext/ProductContext.tsx b/react/components/ProductContext/ProductContext.tsx index 5e310b1..13250bc 100644 --- a/react/components/ProductContext/ProductContext.tsx +++ b/react/components/ProductContext/ProductContext.tsx @@ -1,10 +1,20 @@ -import React from "react"; +import React, { useEffect } from "react"; import { useProduct } from "vtex.product-context"; -import styles from './styles.css' +import styles from "./styles.css"; const ProductContext = () => { + useEffect(() => { + const intervalId = setInterval(() => { + const cepInput = document.querySelector(".vtex-address-form-4-x-input"); + if (cepInput) { + cepInput.setAttribute("placeholder", "Digite seu CEP"); + console.log(cepInput); + clearInterval(intervalId); + } + }, 50); + }, []); + const productContextValue = useProduct(); - console.log(productContextValue); return (
@@ -15,8 +25,10 @@ const ProductContext = () => { />
-

{productContextValue?.product?.priceRange?.sellingPrice?.highPrice}

-

10 % de desconto

+

+ {productContextValue?.product?.priceRange?.sellingPrice?.highPrice} +

+

10 % de desconto

); diff --git a/store/blocks/pdp/product.jsonc b/store/blocks/pdp/product.jsonc index df61590..d2e901b 100644 --- a/store/blocks/pdp/product.jsonc +++ b/store/blocks/pdp/product.jsonc @@ -127,14 +127,13 @@ }, "product-images": { "props": { - "width": "40%", "contentType": "images", "showNavigationArrows": false, "showPaginationDots": false, "thumbnailsOrientation": "horizontal", "aspectRatio": { "desktop": "auto", - "phone": "16:9" + "phone": "auto" }, "displayThumbnailsArrows": true } @@ -154,7 +153,6 @@ "flex-layout.col#right-col": { "props": { - "width": "60%", "preventVerticalStretch": true, "rowGap": 0 }, diff --git a/styles/css/vtex.condition-layout.css b/styles/css/vtex.condition-layout.css index e69de29..234303d 100644 --- a/styles/css/vtex.condition-layout.css +++ b/styles/css/vtex.condition-layout.css @@ -0,0 +1,11 @@ +@media screen and (max-width: 1024px) { + .flexRowContent { + display: flex; + flex-direction: column; + } +} + +.flexRowContent { + margin-right: 40px; + margin-left: 40px; +} diff --git a/styles/css/vtex.flex-layout.css b/styles/css/vtex.flex-layout.css index d409ed4..274fbca 100644 --- a/styles/css/vtex.flex-layout.css +++ b/styles/css/vtex.flex-layout.css @@ -3,6 +3,13 @@ padding: 0 0.5rem; } +@media screen and (max-width: 1024px) { + .flexRowContent { + display: flex; + flex-direction: column; + } +} + @media screen and (min-width: 40em) { .flexRowContent--menu-link, .flexRowContent--main-header { diff --git a/styles/css/vtex.product-identifier.css b/styles/css/vtex.product-identifier.css index 83188ac..0533d57 100644 --- a/styles/css/vtex.product-identifier.css +++ b/styles/css/vtex.product-identifier.css @@ -11,7 +11,6 @@ text-align: right; position: absolute; right: 0; - margin-right: 40px; } .product-identifier--productReference {