Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
],
"linebreak-style":[
"error",
"unix"
"windows"
],
"quotes":[
"error",
Expand Down
277 changes: 277 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
"@types/node": "^16.11.38",
"@types/react": "^18.0.10",
"@types/react-dom": "^18.0.5",
"components": "^0.1.0",
"react": "^18.1.0",
"react-dom": "^18.1.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"recoil": "^0.7.3",
"styled": "^1.0.0",
Comment on lines +13 to +19
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

styled e components aqui acredito que foram instalados por engano, poderia remover.

"styled-components": "^5.3.5",
"typescript": "^4.7.2",
"web-vitals": "^2.1.4"
},
Expand Down Expand Up @@ -43,6 +46,7 @@
]
},
"devDependencies": {
"@types/styled-components": "^5.1.25",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.28.0",
"eslint": "^8.17.0",
Expand Down
Binary file added public/images/14.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/images/image-model-blazer.webp
Binary file not shown.
Binary file removed public/images/image-model-cardigan.webp
Binary file not shown.
Binary file removed public/images/image-model-men-tShirt.webp
Binary file not shown.
Binary file removed public/images/image-model-overcoat.webp
Binary file not shown.
Binary file removed public/images/image-model-printed-tShirt.webp
Binary file not shown.
Binary file removed public/images/image-model-short-dress.webp
Binary file not shown.
Binary file removed public/images/image-model-striped-tShirt.webp
Binary file not shown.
Binary file removed public/images/image-model-white-tShirt.webp
Binary file not shown.
Binary file removed public/images/image-model-women-coat-back.webp
Binary file not shown.
Binary file removed public/images/image-model-women-coat-whole.webp
Binary file not shown.
Binary file removed public/images/image-model-women-coat.webp
Binary file not shown.
Binary file added public/images/imagem_1.1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/imagem_1.2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/imagem_1.3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/imagem_1.4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/imagem_10.1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/imagem_10.2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/imagem_10.3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/imagem_10.4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/imagem_2.1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/imagem_2.2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/imagem_2.3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/imagem_2.4.jpg
Binary file added public/images/imagem_3.1.jpg
Binary file added public/images/imagem_3.2.jpg
Binary file added public/images/imagem_3.3.jpg
Binary file added public/images/imagem_3.4.jpg
Binary file added public/images/imagem_4.1.jpg
Binary file added public/images/imagem_4.2.jpg
Binary file added public/images/imagem_4.3.jpg
Binary file added public/images/imagem_4.4.jpg
Binary file added public/images/imagem_5.1.jpg
Binary file added public/images/imagem_5.2.jpg
Binary file added public/images/imagem_5.3.jpg
Binary file added public/images/imagem_5.4.jpg
Binary file added public/images/imagem_6.1.jpg
Binary file added public/images/imagem_6.2.jpg
Binary file added public/images/imagem_6.3.jpg
Binary file added public/images/imagem_6.4.jpg
Binary file added public/images/imagem_7.1.jpg
Binary file added public/images/imagem_7.2.jpg
Binary file added public/images/imagem_7.3.jpg
Binary file added public/images/imagem_7.4.jpg
Binary file added public/images/imagem_8.1.jpg
Binary file added public/images/imagem_8.2.jpg
Binary file added public/images/imagem_8.3.jpg
Binary file added public/images/imagem_8.4.jpg
Binary file added public/images/imagem_9.1.jpg
Binary file added public/images/imagem_9.2.jpg
Binary file added public/images/imagem_9.3.jpg
Binary file added public/images/imagem_9.4.jpg
12 changes: 12 additions & 0 deletions src/GlobalStyle.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createGlobalStyle } from 'styled-components';
import { font_family_page } from './Variables';

export const GlobalStyle = createGlobalStyle`
body{
font-family: $font-family-page;
text-decoration: none;
overflow-x:hidden ;
scroll-behavior: smooth;
}

`;
21 changes: 21 additions & 0 deletions src/Variables.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export const primary_color = '#FFEF82';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

O Styled Components tem uma forma mais legal de você fazer esse tipo de coisas, criando um tema: https://styled-components.com/docs/advanced#theming


export const secondary_color = '#EFD345';

export const tertiary_color = '#BABD42';

export const quaternary_color = '#82954B';

export const font_size_text = '1em';

export const font_size_title = '3em';

export const font_size_subtitle = '4em';

export const font_family_page = '\'Roboto\', sans serif';

export const font_weight_text = '300';

export const font_weight_title = 'bold';


16 changes: 0 additions & 16 deletions src/pages/assets/base.scss

This file was deleted.

27 changes: 0 additions & 27 deletions src/pages/cart/BillingReview/BillingReview.module.scss

This file was deleted.

35 changes: 18 additions & 17 deletions src/pages/cart/BillingReview/BillingReview.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
import { cartState } from 'pages/state/atoms/cartState';
import { useRecoilValue } from 'recoil';
import style from './BillingReview.module.scss';
import { cartState } from 'state/atoms/dynamic/cartState';
import { ButtonPayment, ReviewPayment, ReviewPaymentConfig } from './BillingReviewStyle';

export function BillingReview() {

const getCart = useRecoilValue(cartState);
const cart = [...getCart];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Você não precisa duplicar o cart aqui.

const total = cart.reduce((acc, currentValue) => (acc += currentValue.price),0);
const total = cart.reduce(
(acc, currentValue) => (acc += (currentValue.price*currentValue.units_in_cart)),
0
);

return (


<div className={style.review__payment}>
<div className={style['review__payment--config']}>
<ReviewPayment>
<ReviewPaymentConfig>
{cart.map((productsInCart) => {
return (
<>
<p key={productsInCart.id} >2x{(productsInCart.price + productsInCart.price * 0.1).toFixed(2)} = R$ {productsInCart.price.toFixed(2)}</p>

<p key={productsInCart.id}>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acho que a tag P não é a melhor pra esse caso, se pensarmos bem, é uma lista de itens, talvez uma ul li fizesse mais sentido.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isso poderia ser um componente

{productsInCart.units_in_cart}x
{(productsInCart.price).toFixed(2)}{' '}
= R$ {(productsInCart.price*productsInCart.units_in_cart).toFixed(2)}
</p>
</>
);
})}
})}
<p>Total: R${total.toFixed(2)}</p>
<button>Ir para pagamento</button>
</div>


</div>
<ButtonPayment as='button'>Ir para pagamento</ButtonPayment>
</ReviewPaymentConfig>
</ReviewPayment>
);
}
}
40 changes: 40 additions & 0 deletions src/pages/cart/BillingReview/BillingReviewStyle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { CartButtonDetails } from '../../components/Button/ButtonStyle';
import styled from 'styled-components';
import { font_size_text, font_weight_text, primary_color, tertiary_color } from 'Variables';
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelCase é mais comum para nomear variáveis no JavaScript/TypeScript.


export const ReviewPayment = styled.div`
width: 100%;
button {
display: block;
margin: auto;
margin-top: 159%;
border: none;
height: 3em;
background-color: $tertiary-color;
}

button:hover {
color: white;
cursor: pointer;
}
`;

export const ReviewPaymentConfig = styled.div`
height: 100%;
padding: 11%;
padding-top: 0;
text-align: center;
font-weight: ${font_weight_text};
font-size:calc(${font_size_text}*1.5);
background-color: ${tertiary_color};
`;

export const ButtonPayment = styled(CartButtonDetails)`
background-color:${primary_color};
width: 205px;
color:black;
&:hover{
border: 1px solid ${primary_color};
background-color:transparent;
}
`;
16 changes: 5 additions & 11 deletions src/pages/cart/CartIndex.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import { ProductReview } from './ProductReview/ProductReview';

export function Cart() {
return <>

return (
<main>

<h1>Minha sacola</h1>
<section className="review">
<ProductReview/>
</section>

<h1>Minha sacola</h1>
<ProductReview />
</main>

</>;
}
);
}
11 changes: 0 additions & 11 deletions src/pages/cart/ImageProductReview/ImageProductReview.module.scss

This file was deleted.

22 changes: 0 additions & 22 deletions src/pages/cart/ImageProductReview/ImageProductReview.tsx

This file was deleted.

20 changes: 0 additions & 20 deletions src/pages/cart/InfoReview/InfoReview.module.scss

This file was deleted.

51 changes: 24 additions & 27 deletions src/pages/cart/InfoReview/InfoReview.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Componentes não deveriam estar dentro de Pages.

import { cartState } from 'pages/state/atoms/cartState';
import { useRecoilValue } from 'recoil';
import { ImageProductReview } from '../ImageProductReview/ImageProductReview';
import { cartState } from 'state/atoms/dynamic/cartState';
import style from './InfoReview.module.scss';
import {
InfoReviewContent,
InfoReviewTemplate,
InfoReviewTitle,
} from './InfoReviewStyle';
import { ReviewItem } from './ReviewItem/ReviewItem';
import { ReviewTitle } from './ReviewTitle/ReviewTitle';

export function InfoReview() {

const getItem = useRecoilValue(cartState);

const productsInCart = [...getItem];


//console.log(productsOnCart)
return (
<div className={`${style.review__info}`}>

<InfoReviewTemplate>
<>
<div className={style['review__info--title']} >
<InfoReviewTitle>
<ReviewTitle />

</div>
{
productsInCart.map((product, productCartindex) => {
return (
<div key={product.id} className={style['review__info--item']}>

<ReviewItem
//melhorar esse codigo

item={productsInCart.find((_, indice) => indice === productCartindex)}
/>
</div>

);
})
}
</InfoReviewTitle>
{productsInCart.map((product, productCartindex) => {
return (
<InfoReviewContent key={product.id}>
<ReviewItem
//melhorar esse codigo

item={productsInCart.find(
(_, indice) => indice === productCartindex
)}
Comment on lines +30 to +32
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aqui você já tem o product em uma variável, buscar ele pelo índice novamente dentro do array não faz sentido.

/>
</InfoReviewContent>
);
})}
</>
</div>
</InfoReviewTemplate>
);
}
}
22 changes: 22 additions & 0 deletions src/pages/cart/InfoReview/InfoReviewStyle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import styled from 'styled-components';

export const InfoReviewTemplate = styled.div`
display: grid;
grid-template-columns: 3fr;
grid-template-rows: 1fr auto;
padding: 0 1%;
width:100%;
`;

export const InfoReviewTitle = styled.div`
display: flex;
flex-direction: row;
justify-content: space-around;
`;

export const InfoReviewContent = styled.div`
display: flex;
align-items: center;
flex-direction: row;
justify-content: space-around;
`;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CartProducts } from '../../../../state/atoms/cartState';

import { updateValues } from '../../../../utils/updateValue';
import { ProductsInCartProps } from '../ReviewItem';

Expand Down
Loading