2023-02-04 22:20:18 +00:00
|
|
|
import React from "react";
|
|
|
|
import { useProduct } from "vtex.product-context";
|
|
|
|
|
2023-02-06 17:41:25 +00:00
|
|
|
import styles from "./styles.css";
|
|
|
|
|
2023-02-04 22:20:18 +00:00
|
|
|
const PaymentPix = () => {
|
|
|
|
const product = useProduct();
|
|
|
|
const pricePix = (
|
|
|
|
(product?.product?.priceRange.sellingPrice.highPrice || 0.0) * 0.9
|
|
|
|
).toFixed(2);
|
2023-02-06 17:41:25 +00:00
|
|
|
|
|
|
|
const imagePix =
|
|
|
|
"https://agenciamagma.vtexassets.com/arquivos/imgPix-savio-carvalho.png";
|
2023-02-04 22:20:18 +00:00
|
|
|
|
|
|
|
const convertPrice = pricePix.toString().replace(".", ",");
|
|
|
|
|
|
|
|
return (
|
2023-02-06 17:41:25 +00:00
|
|
|
<div className={styles.paymentPixWrapper}>
|
|
|
|
<img
|
|
|
|
className={styles.paymentPixImg}
|
|
|
|
src={imagePix}
|
|
|
|
alt="Imagem do Pix"
|
|
|
|
/>
|
|
|
|
<div className={styles.paymentPixText}>
|
|
|
|
<p className={styles.paymentPixValue}>R$ {convertPrice}</p>
|
|
|
|
<p className={styles.paymentPixDiscount}>10% de desconto</p>
|
|
|
|
</div>
|
2023-02-04 22:20:18 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export { PaymentPix };
|