Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| "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", |
There was a problem hiding this comment.
styled e components aqui acredito que foram instalados por engano, poderia remover.
| @@ -0,0 +1,21 @@ | |||
| export const primary_color = '#FFEF82'; | |||
There was a problem hiding this comment.
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 function BillingReview() { | ||
|
|
||
| const getCart = useRecoilValue(cartState); | ||
| const cart = [...getCart]; |
There was a problem hiding this comment.
Você não precisa duplicar o cart aqui.
| <> | ||
| <p key={productsInCart.id} >2x{(productsInCart.price + productsInCart.price * 0.1).toFixed(2)} = R$ {productsInCart.price.toFixed(2)}</p> | ||
|
|
||
| <p key={productsInCart.id}> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Isso poderia ser um componente
| @@ -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'; | |||
There was a problem hiding this comment.
camelCase é mais comum para nomear variáveis no JavaScript/TypeScript.
| <div className={style['details__button--size--m']}> | ||
| <input type="radio" name="size" value="1" id="radio-2" /> | ||
| <label htmlFor="radio-2">Tamanho M</label> | ||
| </div> |
There was a problem hiding this comment.
deveria ter removido os comentários.
| <BoxModel data-id={index}> | ||
| <Link to={'/details/' + element.id}> | ||
| <DivImageButtons> | ||
| <ImageProducts |
There was a problem hiding this comment.
Se vai mostrar apenas a imagem de um produto, por que o componente tá no plural?
|
|
||
| const recomendations = useRecoilValue(storageState); | ||
| const displayRecomendations = [...recomendations]; | ||
| const id = useParams().id; |
There was a problem hiding this comment.
poderia fazer destructuring direto.
|
|
||
| export const buttonSizeState = atom<ButtonSize[]>({ | ||
| key: 'buttonSizeState', | ||
| default: [{ |
There was a problem hiding this comment.
Isso não deveria ser um estado, já que a mudança desse estado pode propagar para toda a aplicação que um determinado tamanho de produto não está mais disponível.
| export const cartTitlesState = atom<string[]>({ | ||
| key: 'cartTitlesState', | ||
| default: ['Produto', 'Tamanho escolhido', 'Valor', 'Quantidade', 'Subtotal'], | ||
| }); |
There was a problem hiding this comment.
Isso também não deveria ser um estado, isso nunca vai mudar.
No description provided.