forked from M3-Academy/challenge-vtex-io
development #9
3
react/PaymentPix.tsx
Normal file
3
react/PaymentPix.tsx
Normal file
@ -0,0 +1,3 @@
|
||||
import { PaymentPix } from "./components/PaymentPix/PaymentPix";
|
||||
|
||||
export default PaymentPix;
|
@ -1,3 +0,0 @@
|
||||
import { ProductDescription } from "./components/ProductDescription/ProductDescription";
|
||||
|
||||
export default ProductDescription;
|
23
react/components/PaymentPix/PaymentPix.tsx
Normal file
23
react/components/PaymentPix/PaymentPix.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
import React from "react";
|
||||
import { useProduct } from "vtex.product-context";
|
||||
|
||||
const PaymentPix = () => {
|
||||
const product = useProduct();
|
||||
const pricePix = (
|
||||
(product?.product?.priceRange.sellingPrice.highPrice || 0.0) * 0.9
|
||||
).toFixed(2);
|
||||
{
|
||||
/*const imagePix =*/
|
||||
}
|
||||
|
||||
const convertPrice = pricePix.toString().replace(".", ",");
|
||||
|
||||
return (
|
||||
<div>
|
||||
<p>R$ {convertPrice}</p>
|
||||
<p>10% de desconto</p>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export { PaymentPix };
|
@ -1,7 +0,0 @@
|
||||
import React from "react";
|
||||
|
||||
const ProductDescription = () => {
|
||||
return <div>Oaswq</div>;
|
||||
};
|
||||
|
||||
export { ProductDescription };
|
@ -2,7 +2,9 @@
|
||||
"store.product": {
|
||||
"children": [
|
||||
"html#breadcrumb",
|
||||
|
||||
"condition-layout.product#availability",
|
||||
|
||||
"flex-layout.row#description",
|
||||
"flex-layout.row#specifications-title",
|
||||
"tab-layout#product",
|
||||
@ -117,6 +119,7 @@
|
||||
"flex-layout.row#list-price-savings",
|
||||
"flex-layout.row#selling-price",
|
||||
"product-installments",
|
||||
"product-paymentPix-component",
|
||||
"product-separator",
|
||||
"product-identifier.product",
|
||||
"sku-selector",
|
||||
|
@ -6,7 +6,7 @@
|
||||
"component": "html",
|
||||
"composition": "children"
|
||||
},
|
||||
"product-payment-component": {
|
||||
"component": "ProductDescription"
|
||||
"product-paymentPix-component": {
|
||||
"component": "PaymentPix"
|
||||
}
|
||||
}
|
||||
|
@ -13,9 +13,4 @@
|
||||
|
||||
.homeLink::after {
|
||||
content: "Home";
|
||||
}
|
||||
|
||||
.link--1 {
|
||||
display: flex;
|
||||
order: -1;
|
||||
}
|
@ -7,6 +7,7 @@
|
||||
*/
|
||||
/* Media Query M3 */
|
||||
/* Grid breakpoints */
|
||||
.productDescriptionContainer {
|
||||
/*.productDescriptionContainer {
|
||||
background: red;
|
||||
}
|
||||
}
|
||||
*/
|
@ -6,7 +6,3 @@
|
||||
content: "Home";
|
||||
}
|
||||
}
|
||||
.link--1 {
|
||||
display: flex;
|
||||
order: -1;
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
.productDescriptionContainer {
|
||||
/*.productDescriptionContainer {
|
||||
background: red;
|
||||
}
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user