2023-01-23 01:53:11 +00:00
|
|
|
import React, { FC } from 'react'
|
|
|
|
import { useProduct } from 'vtex.product-context'
|
|
|
|
import styles from "./styles.css";
|
|
|
|
|
|
|
|
export const DescontPix: FC = () => {
|
|
|
|
|
|
|
|
const productContextValue = useProduct();
|
2023-01-25 21:45:51 +00:00
|
|
|
|
2023-01-28 01:15:01 +00:00
|
|
|
let sellingPrice = Number(productContextValue?.product?.priceRange.sellingPrice.lowPrice);
|
2023-01-23 01:53:11 +00:00
|
|
|
sellingPrice = (sellingPrice - (sellingPrice/10));
|
2023-01-24 14:33:36 +00:00
|
|
|
|
2023-01-25 21:45:51 +00:00
|
|
|
|
2023-01-23 01:53:11 +00:00
|
|
|
return (
|
|
|
|
<div className={styles.containerDescontPix}>
|
2023-01-25 00:23:44 +00:00
|
|
|
<img src="https://agenciamagma.vteximg.com.br/arquivos/logoPixjosecarloslins.png" alt="Logo PIX" />
|
2023-01-23 01:53:11 +00:00
|
|
|
<div className={styles.containerDescontPixPrice}>
|
2023-02-06 18:57:59 +00:00
|
|
|
<p className={styles.priceDescontPix}>R$ {sellingPrice.toFixed(2).replace(".", ",")}</p>
|
|
|
|
<p className={styles.descontDescontPix}>10 % de desconto</p>
|
2023-01-23 01:53:11 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|