forked from M3-Academy/challenge-vtex-io
feature/paymentPix #3
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": {
|
"store.product": {
|
||||||
"children": [
|
"children": [
|
||||||
"html#breadcrumb",
|
"html#breadcrumb",
|
||||||
|
|
||||||
"condition-layout.product#availability",
|
"condition-layout.product#availability",
|
||||||
|
|
||||||
"flex-layout.row#description",
|
"flex-layout.row#description",
|
||||||
"flex-layout.row#specifications-title",
|
"flex-layout.row#specifications-title",
|
||||||
"tab-layout#product",
|
"tab-layout#product",
|
||||||
@ -117,6 +119,7 @@
|
|||||||
"flex-layout.row#list-price-savings",
|
"flex-layout.row#list-price-savings",
|
||||||
"flex-layout.row#selling-price",
|
"flex-layout.row#selling-price",
|
||||||
"product-installments",
|
"product-installments",
|
||||||
|
"product-paymentPix-component",
|
||||||
"product-separator",
|
"product-separator",
|
||||||
"product-identifier.product",
|
"product-identifier.product",
|
||||||
"sku-selector",
|
"sku-selector",
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"component": "html",
|
"component": "html",
|
||||||
"composition": "children"
|
"composition": "children"
|
||||||
},
|
},
|
||||||
"product-payment-component": {
|
"product-paymentPix-component": {
|
||||||
"component": "ProductDescription"
|
"component": "PaymentPix"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,8 +14,3 @@
|
|||||||
.homeLink::after {
|
.homeLink::after {
|
||||||
content: "Home";
|
content: "Home";
|
||||||
}
|
}
|
||||||
|
|
||||||
.link--1 {
|
|
||||||
display: flex;
|
|
||||||
order: -1;
|
|
||||||
}
|
|
@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
/* Media Query M3 */
|
/* Media Query M3 */
|
||||||
/* Grid breakpoints */
|
/* Grid breakpoints */
|
||||||
.productDescriptionContainer {
|
/*.productDescriptionContainer {
|
||||||
background: red;
|
background: red;
|
||||||
}
|
}
|
||||||
|
*/
|
@ -6,7 +6,3 @@
|
|||||||
content: "Home";
|
content: "Home";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.link--1 {
|
|
||||||
display: flex;
|
|
||||||
order: -1;
|
|
||||||
}
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
.productDescriptionContainer {
|
/*.productDescriptionContainer {
|
||||||
background: red;
|
background: red;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap");
|
||||||
|
|
||||||
$color-black: #292929;
|
$color-black: #292929;
|
||||||
|
|
||||||
$color-white: #fff;
|
$color-white: #fff;
|
||||||
@ -14,18 +16,18 @@ $color-green: #4caf50;
|
|||||||
|
|
||||||
/* Grid breakpoints */
|
/* Grid breakpoints */
|
||||||
$grid-breakpoints: (
|
$grid-breakpoints: (
|
||||||
xs: 0,
|
xs: 0,
|
||||||
cstm: 400,
|
cstm: 400,
|
||||||
sm: 576px,
|
sm: 576px,
|
||||||
md: 768px,
|
md: 768px,
|
||||||
lg: 992px,
|
lg: 992px,
|
||||||
xl: 1200px
|
xl: 1200px,
|
||||||
) !default;
|
) !default;
|
||||||
|
|
||||||
$z-index: (
|
$z-index: (
|
||||||
level1: 5,
|
level1: 5,
|
||||||
level2: 10,
|
level2: 10,
|
||||||
level3: 15,
|
level3: 15,
|
||||||
level4: 20,
|
level4: 20,
|
||||||
level5: 25
|
level5: 25,
|
||||||
) !default;
|
) !default;
|
||||||
|
Loading…
Reference in New Issue
Block a user