feat: Adiciona pix

This commit is contained in:
Izabela Balizardo 2023-02-03 19:49:19 -03:00
parent c9882ca401
commit 371a137ab4
7 changed files with 33 additions and 34 deletions

4
react/Pix.ts Normal file
View File

@ -0,0 +1,4 @@
import Pix from "./components/Pix/Pix";
export default Pix;

View File

@ -1,3 +0,0 @@
// import { Pix } from "./components/Pix/Pix";
// export default Pix;

View File

@ -1,31 +1,26 @@
// import React, { FC } from "react";
// import { useProduct } from "vtex.product-context";
// import pix from "./pix.svg";
import React from "react";
import { useProduct } from "vtex.product-context";
// const ProductValue = () => {
// const productValue = useProduct();
// export const PixProduct: FC = () => {
// const productContextValue = useProduct();
// const vavazinha =
// productContextValue?.product?.priceRange?.sellingPrice?.highPrice;
const Pix = () => {
const productContextValue = useProduct()?.product?.priceRange?.sellingPrice
?.highPrice;
// console.log('productValue', productValue);
return (
<>
<div>
<img src="https://agenciamagma.vtexassets.com/arquivos/pix_izabela.svg" alt="Pix" />
{`R$ ${(productContextValue! - productContextValue! * 0.1)
.toFixed(2)
.replace(".", ",")}`
}
<p>
10% de desconto
</p>
</div>
// // return <>oi</>;
// return (
// <>
// <div>
// <img src={pix} alt="Pix" />
// {`R$ ${(vavazinha! - vavazinha! * 0.1)
// .toFixed(2)
// .replace(".", ",")}`
// }
// <span>
// 10% de desconto
// </span>
// </div>
// </>
// );
// };
</>
);
};
// export default ProductValue;
export default Pix;

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -91,7 +91,8 @@
"desktop": "auto",
"phone": "16:9"
},
"displayThumbnailsArrows": true
"thumbnailsOrientation": "horizontal",
"displayThumbnailsArrows": false
}
},
"flex-layout.col#right-col": {
@ -103,7 +104,7 @@
"flex-layout.row#product-name",
"product-identifier.product",
"product-rating-summary",
// "use-product",
"Pix",
"flex-layout.row#list-price-savings",
"flex-layout.row#selling-price",
"product-installments",

View File

@ -5,5 +5,9 @@
"html": {
"component": "html",
"composition": "children"
},
"Pix": {
"component": "Pix"
}
}

View File

@ -103,8 +103,6 @@
.shippingTable {
.shippingTableRadioBtn {
display: none;
}
.shippingTableHead {