feat: aplica e estiliza o placeholder do cep

This commit is contained in:
Sabrina Miranda 2023-02-08 17:02:25 -03:00
parent 15b7fae3e1
commit 98e024c555
3 changed files with 30 additions and 6 deletions

View File

@ -1,18 +1,27 @@
import React from 'react'; import React, { useEffect } from 'react';
import { useProduct } from 'vtex.product-context'; import { useProduct } from 'vtex.product-context';
import styles from './styles.css'; import styles from './styles.css';
const Pix = () => { const Pix = () => {
const productContextValue = useProduct(); // CEP Placeholder --------------------------------------------------------------
//console.log(productContextValue);
const price = productContextValue?.product?.priceRange?.sellingPrice?.lowPrice; useEffect(() => {
const inputCep = document.querySelector(".vtex-address-form-4-x-input");
const discount = (Number(price) * (10 / 100)); inputCep?.setAttribute("placeholder", "Digite seu CEP");
});
const pixValue = (Number(price) - Number(discount)); // Pix --------------------------------------------------------------------------
const productContextValue = useProduct();
//console.log(productContextValue);
const price = productContextValue?.product?.priceRange?.sellingPrice?.lowPrice;
const discount = (Number(price) * (10 / 100));
const pixValue = (Number(price) - Number(discount));
return ( return (
<> <>

View File

@ -265,6 +265,12 @@
position: absolute; position: absolute;
margin: 2px; margin: 2px;
} }
.shippingContainer :global(.vtex-address-form-4-x-input)::placeholder {
font-weight: 400;
font-size: 12px;
line-height: 16px;
color: #AFAFAF;
}
.shippingTable { .shippingTable {
margin: 16px 0 0 0; margin: 16px 0 0 0;

View File

@ -274,6 +274,15 @@
position: absolute; position: absolute;
margin: 2px; margin: 2px;
} }
:global(.vtex-address-form-4-x-input) {
&::placeholder {
font-weight: 400;
font-size: 12px;
line-height: 16px;
color: #AFAFAF;
}
}
} }
.shippingTable { .shippingTable {