feat: Adiciona o placeholder para o CEP e Email no produto indisponivel

This commit is contained in:
Nicolly Vieira Santos Costa 2023-01-30 11:02:18 -03:00
parent fa0c5ee212
commit 96223b6b9c
15 changed files with 89 additions and 50 deletions

View File

@ -1,3 +0,0 @@
import Installments from "./components/Installments";
export default Installments;

3
react/Placeholder.tsx Normal file
View File

@ -0,0 +1,3 @@
import Placeholder from "./components/Placeholder/index";
export default Placeholder;

View File

@ -246,7 +246,7 @@
@media screen and (min-width: 1920px) {
[class*="html--pdp-breadcrumb"] {
margin: 0 360px;
margin: 16px 360px;
}
[class*="html--product-main"] {

View File

@ -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 (
<p className={styles.parcelas}>
<strong>
{installment.numberOfInstallments} x{" "}
</strong>
de
<strong>
{" "}
R$ {installment.value?.toFixed(2).toString().replace(".", ",")}
</strong>{" "}
sem juros
</p>
);
};
export default Installments;

View File

@ -1,9 +0,0 @@
.parcelas {
margin: 0;
font-style: normal;
font-weight: 400;
font-size: 16px;
line-height: 22px;
color: #929292;
margin-bottom: 8px;
}

View File

@ -1,7 +1,7 @@
.pixWrapper {
display: flex;
gap: 26px;
margin-bottom: 16px;
margin:8px 0 16px;
align-items: center;
}

View File

@ -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;

View File

@ -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 <discount>{installmentsNumber}x</discount> de <discount>R${installmentValue}</discount> sem juros",
"installmentsCriteria": "max-quantity-without-interest"
}
},
"html#sku-selector": {
"props": {
"blockClass": "sku-selector",

View File

@ -7,10 +7,11 @@
"composition": "children"
},
"installments": {
"component": "Installments"
"placeholder": {
"component": "Placeholder"
},
"pix": {
"component": "Pix"
}

View File

@ -13,4 +13,16 @@
font-size: 25px;
line-height: 38px;
color: #000;
}
.installments {
margin: 0;
font-style: normal;
font-weight: 400;
font-size: 16px;
line-height: 22px;
color: #929292;
}
.installments .installments-discount {
font-weight: 700;
}

View File

@ -31,6 +31,9 @@
font-size: 16px;
line-height: 22px;
}
.quantitySelectorContainer :global(.vtex-numeric-stepper__input):focus {
outline: none;
}
.quantitySelectorContainer :global(.vtex-numeric-stepper__minus-button-container) {
justify-content: center;

View File

@ -233,6 +233,14 @@
padding: 16.5px 16px;
margin: 0;
}
.shippingContainer :global(.vtex-address-form-4-x-input)::placeholder {
font-style: normal;
font-weight: 400;
font-size: 12px;
line-height: 16px;
display: flex;
color: #afafaf;
}
.shippingContainer :global(.vtex__icon-external-link) {
display: none;

View File

@ -7,5 +7,14 @@
}
.installments {
// background: red;
margin: 0;
font-style: normal;
font-weight: 400;
font-size: 16px;
line-height: 22px;
color: #929292;
.installments-discount {
font-weight: 700;
}
}

View File

@ -22,6 +22,10 @@
font-weight: 400;
font-size: 16px;
line-height: 22px;
&:focus {
outline: none;
}
}
.quantitySelectorContainer

View File

@ -278,6 +278,14 @@
.shippingContainer :global(.vtex-address-form-4-x-input) {
padding: 16.5px 16px;
margin: 0;
&::placeholder {
font-style: normal;
font-weight: 400;
font-size: 12px;
line-height: 16px;
display: flex;
color: #afafaf;
}
}
.shippingContainer :global(.vtex__icon-external-link) {
display: none;