feature/sabrinamiranda #1

Merged
SabrinaMiranda merged 33 commits from feature/sabrinamiranda into master 2023-02-10 23:17:10 +00:00
8 changed files with 88 additions and 2 deletions
Showing only changes of commit 99c9445b7b - Show all commits

1
react/Pix.tsx Normal file
View File

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

View File

@ -104,3 +104,10 @@
[class*="html--right-col"] button { [class*="html--right-col"] button {
display: none; display: none;
} }
[class*="html--pix"] {
display: flex;
align-items: center;
margin-top: 8px;
margin-bottom: 16px;
}

View File

@ -0,0 +1,33 @@
import React from 'react';
import { useProduct } from 'vtex.product-context';
import styles from './styles.css';
const Pix = () => {
const productContextValue = useProduct();
//console.log(productContextValue);
const price = productContextValue?.product?.priceRange?.sellingPrice?.lowPrice;
const discount = (Number(price) * (10 / 100));
const pixValue = (Number(price) - Number(discount));
return (
<>
<img
className={styles.pixImage}
src=' https://agenciamagma.vteximg.com.br/arquivos/pix-sabrinamiranda.png'
alt='Imagem Pix'
/>
<div className={styles.pixText}>
<p className={styles.pixPrice}>R$ {pixValue.toFixed(2).replace("." , ",")}</p>
<p className={styles.pixDiscount}>10 % de desconto</p>
</div>
</>
);
}
export default Pix;

View File

@ -0,0 +1,26 @@
.pixImage {
margin-right: 26px;
width: 66px;
height: 24px;
}
.pixText {
display: flex;
flex-direction: column;
}
.pixPrice {
margin: 0;
font-weight: 700;
font-size: 18px;
line-height: 25px;
color: rgba(0, 0, 0, 0.58);
}
.pixDiscount {
margin: 0;
font-weight: 300;
font-size: 13px;
line-height: 18px;
color: #929292;
}

View File

@ -130,6 +130,14 @@
] ]
}, },
"html#pix-price": {
"props": {
"blockClass": "pix",
"testId": "pix-price"
},
"children": ["pix-component"]
},
"html#right-col": { "html#right-col": {
"props": { "props": {
"tag": "section", "tag": "section",
@ -141,6 +149,7 @@
"product-rating-summary", "product-rating-summary",
"flex-layout.row#selling-price", "flex-layout.row#selling-price",
"product-installments#m3", "product-installments#m3",
"html#pix-price",
"html#sku-selector-m3", "html#sku-selector-m3",
"html#product-quantity-cart-button", "html#product-quantity-cart-button",
"product-assembly-options", "product-assembly-options",

View File

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

View File

@ -63,10 +63,13 @@
color: #929292; color: #929292;
} }
*/ */
.skuSelectorNameContainer {
margin: 0;
}
.skuSelectorContainer { .skuSelectorContainer {
display: flex; display: flex;
flex-direction: column-reverse; flex-direction: column-reverse;
margin-top: 16px;
margin-bottom: 16px; margin-bottom: 16px;
} }
.skuSelectorContainer :global(.vtex-store-components-3-x-skuSelectorItemImageValue) { .skuSelectorContainer :global(.vtex-store-components-3-x-skuSelectorItemImageValue) {

View File

@ -52,10 +52,14 @@
color: #929292; color: #929292;
} }
*/ */
.skuSelectorNameContainer {
margin: 0;
}
.skuSelectorContainer { .skuSelectorContainer {
display: flex; display: flex;
flex-direction: column-reverse; flex-direction: column-reverse;
margin-top: 16px;
margin-bottom: 16px; margin-bottom: 16px;
:global(.vtex-store-components-3-x-skuSelectorItemImageValue) { :global(.vtex-store-components-3-x-skuSelectorItemImageValue) {