diff --git a/react/Installments.tsx b/react/Installments.tsx deleted file mode 100644 index 679a337..0000000 --- a/react/Installments.tsx +++ /dev/null @@ -1,3 +0,0 @@ -import Installments from "./components/Installments"; - -export default Installments; diff --git a/react/Placeholder.tsx b/react/Placeholder.tsx new file mode 100644 index 0000000..53ea3ff --- /dev/null +++ b/react/Placeholder.tsx @@ -0,0 +1,3 @@ +import Placeholder from "./components/Placeholder/index"; + +export default Placeholder; diff --git a/react/components/Html/styles.css b/react/components/Html/styles.css index be5dd61..b3d9bbd 100644 --- a/react/components/Html/styles.css +++ b/react/components/Html/styles.css @@ -246,7 +246,7 @@ @media screen and (min-width: 1920px) { [class*="html--pdp-breadcrumb"] { - margin: 0 360px; + margin: 16px 360px; } [class*="html--product-main"] { diff --git a/react/components/Installments/index.tsx b/react/components/Installments/index.tsx deleted file mode 100644 index abe4a7e..0000000 --- a/react/components/Installments/index.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import React from "react"; -import { useProduct } from "vtex.product-context"; -import styles from "./styles.css"; - -const Installments = () => { - const product = useProduct(); - const installment = { - numberOfInstallments: - product?.selectedItem?.sellers[0].commertialOffer?.Installments[3] - .NumberOfInstallments, - value: - product?.selectedItem?.sellers[0].commertialOffer?.Installments[3].Value, - }; - return ( -
- - {installment.numberOfInstallments} x{" "} - - de - - {" "} - R$ {installment.value?.toFixed(2).toString().replace(".", ",")} - {" "} - sem juros -
- ); -}; - -export default Installments; diff --git a/react/components/Installments/styles.css b/react/components/Installments/styles.css deleted file mode 100644 index eb2a254..0000000 --- a/react/components/Installments/styles.css +++ /dev/null @@ -1,9 +0,0 @@ -.parcelas { - margin: 0; - font-style: normal; - font-weight: 400; - font-size: 16px; - line-height: 22px; - color: #929292; - margin-bottom: 8px; -} diff --git a/react/components/Pix/styles.css b/react/components/Pix/styles.css index 3b482f6..c87225f 100644 --- a/react/components/Pix/styles.css +++ b/react/components/Pix/styles.css @@ -1,7 +1,7 @@ .pixWrapper { display: flex; gap: 26px; - margin-bottom: 16px; + margin:8px 0 16px; align-items: center; } diff --git a/react/components/Placeholder/index.tsx b/react/components/Placeholder/index.tsx new file mode 100644 index 0000000..53b6166 --- /dev/null +++ b/react/components/Placeholder/index.tsx @@ -0,0 +1,21 @@ +import React from "react"; + +const Example = () => { + if (typeof document !== "undefined") { + const inputCEP = document.querySelector(".vtex-address-form-4-x-input"); + const inputEmail = document.querySelector(".vtex-store-components-3-x-inputEmail"); + + if (inputCEP) { + inputCEP.setAttribute("placeholder", "Digite seu CEP"); + } + + if (inputEmail) { + console.log(inputEmail.children[0].children[0].children[0].setAttribute("placeholder", "E-mail")); + + } + } + + return <>>; +}; + +export default Example; diff --git a/store/blocks/pdp/product.jsonc b/store/blocks/pdp/product.jsonc index a6d87b7..ba7e623 100644 --- a/store/blocks/pdp/product.jsonc +++ b/store/blocks/pdp/product.jsonc @@ -1,6 +1,7 @@ { "store.product": { "children": [ + "placeholder", "html#breadcrumb", "condition-layout.product#availability", "tab-layout#description", @@ -57,7 +58,8 @@ }, "product-summary.shelf#related-product": { - "children": [ "html#product-item" + "children": [ + "html#product-item" // "product-summary-image#related-product", // "product-summary-name", // "product-summary-price" @@ -278,8 +280,8 @@ // "product-rating-summary", // "flex-layout.row#list-price-savings", "html#selling-price", - // "product-installments", - "installments", + "product-installments", + // "installments", // "product-separator", "html#pix", "html#sku-selector", @@ -294,6 +296,15 @@ ] }, + "product-installments": { + "props": { + "markers": ["discount"], + "blockClass": "installments", + "message": "ou