From 371a137ab4c1cc447da72b21b26312db7cce5688 Mon Sep 17 00:00:00 2001 From: Izabela Balizardo Date: Fri, 3 Feb 2023 19:49:19 -0300 Subject: [PATCH] feat: Adiciona pix --- react/Pix.ts | 4 ++ react/Pix.tsx | 3 -- react/components/Pix/Pix.tsx | 49 +++++++++---------- .../Pix/{pix.svg => pix_izabela.svg} | 0 store/blocks/pdp/product.jsonc | 5 +- store/interfaces.json | 4 ++ .../pages/product/vtex.store-components.scss | 2 - 7 files changed, 33 insertions(+), 34 deletions(-) create mode 100644 react/Pix.ts delete mode 100644 react/Pix.tsx rename react/components/Pix/{pix.svg => pix_izabela.svg} (100%) diff --git a/react/Pix.ts b/react/Pix.ts new file mode 100644 index 0000000..06f972d --- /dev/null +++ b/react/Pix.ts @@ -0,0 +1,4 @@ +import Pix from "./components/Pix/Pix"; + + +export default Pix; diff --git a/react/Pix.tsx b/react/Pix.tsx deleted file mode 100644 index d44578a..0000000 --- a/react/Pix.tsx +++ /dev/null @@ -1,3 +0,0 @@ -// import { Pix } from "./components/Pix/Pix"; - -// export default Pix; diff --git a/react/components/Pix/Pix.tsx b/react/components/Pix/Pix.tsx index e9911e4..5f70093 100644 --- a/react/components/Pix/Pix.tsx +++ b/react/components/Pix/Pix.tsx @@ -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 ( + <> +
+ Pix + {`R$ ${(productContextValue! - productContextValue! * 0.1) + .toFixed(2) + .replace(".", ",")}` + } +

+ 10% de desconto +

+
-// // return <>oi; -// return ( -// <> -//
-// Pix -// {`R$ ${(vavazinha! - vavazinha! * 0.1) -// .toFixed(2) -// .replace(".", ",")}` -// } -// -// 10% de desconto -// -//
-// -// ); -// }; + + + ); +}; -// export default ProductValue; +export default Pix; diff --git a/react/components/Pix/pix.svg b/react/components/Pix/pix_izabela.svg similarity index 100% rename from react/components/Pix/pix.svg rename to react/components/Pix/pix_izabela.svg diff --git a/store/blocks/pdp/product.jsonc b/store/blocks/pdp/product.jsonc index f499601..7a0322d 100644 --- a/store/blocks/pdp/product.jsonc +++ b/store/blocks/pdp/product.jsonc @@ -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", diff --git a/store/interfaces.json b/store/interfaces.json index c4b2ac4..849cdc8 100644 --- a/store/interfaces.json +++ b/store/interfaces.json @@ -5,5 +5,9 @@ "html": { "component": "html", "composition": "children" + }, + + "Pix": { + "component": "Pix" } } diff --git a/styles/sass/pages/product/vtex.store-components.scss b/styles/sass/pages/product/vtex.store-components.scss index b8ffe0e..2b5fcb7 100644 --- a/styles/sass/pages/product/vtex.store-components.scss +++ b/styles/sass/pages/product/vtex.store-components.scss @@ -103,8 +103,6 @@ .shippingTable { .shippingTableRadioBtn { display: none; - - } .shippingTableHead {