feat: substitui ponto por virgula valor pix #14

Merged
Rafael_Sampaio_de_Oliveira merged 1 commits from feature/substitui-ponto-por-virgula-valor-pix into development 2023-01-30 14:46:05 +00:00
Showing only changes of commit 2fb64c583a - Show all commits

View File

@ -1,15 +1,15 @@
import React from "react";
import React, { useEffect } from "react";
import { useProduct } from "vtex.product-context";
import styles from "./styles.module.css";
const PixPrice = () => {
// useEffect(() => {
// const inputCep = document.querySelectorAll(".vtex-address-form-4-x-input");
useEffect(() => {
const inputCep = document.querySelectorAll(".vtex-address-form-4-x-input");
// // inputCep.setAttribute('placeholder', 'Digite seu CEP');
// inputCep.setAttribute('placeholder', 'Digite seu CEP');
// console.log(inputCep);
// });
console.log(inputCep);
});
const productContextValue = useProduct();
@ -18,7 +18,7 @@ const PixPrice = () => {
const descount = (Number(productPrice) * 10) / 100;
const total = Number(productPrice) - Number(descount.toFixed(2));
const total = Number(productPrice) - Number(descount);
return (
<div className={styles["pixPrice-container"]}>
@ -30,7 +30,9 @@ const PixPrice = () => {
/>
</div>
<div className={styles["pixPrice-descount"]}>
<p className={styles["pixPrice-value"]}>R$ {total.toFixed(2)}</p>
<p className={styles["pixPrice-value"]}>
R$ {total.toFixed(2).replace(".", ",")}
</p>
<p className={styles["pixPrice-text"]}>10 % de desconto</p>
</div>
</div>