Adiciona o pix a pagina
This commit is contained in:
parent
580c31e5a6
commit
9eab316f99
3
react/Pix.ts
Normal file
3
react/Pix.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import Pix from "./components/Pix/Pix";
|
||||
|
||||
export default Pix;
|
30
react/components/Pix/Pix.tsx
Normal file
30
react/components/Pix/Pix.tsx
Normal file
@ -0,0 +1,30 @@
|
||||
import React from "react";
|
||||
import { useProduct } from "vtex.product-context";
|
||||
|
||||
const Pix = () => {
|
||||
const productContextValue = useProduct()?.product?.priceRange?.sellingPrice
|
||||
?.highPrice;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="pix-container">
|
||||
<div className="pix_img-container">
|
||||
<img
|
||||
src="https://agenciamagma.vtexassets.com/arquivos/icon_pix-m3academyemersonfully.png"
|
||||
alt="Pix"
|
||||
/>
|
||||
</div>
|
||||
<div className="pix_price-container">
|
||||
{`R$ ${(productContextValue! - productContextValue! * 0.1)
|
||||
.toFixed(2)
|
||||
.replace(".", ",")}`}
|
||||
<div className="pix_discount-container">
|
||||
<span>10% de desconto</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Pix;
|
Loading…
Reference in New Issue
Block a user