Skip to content

Semana 8 gabriel#3

Open
brMonteiro-G wants to merge 6 commits intomasterfrom
semana-8-gabriel
Open

Semana 8 gabriel#3
brMonteiro-G wants to merge 6 commits intomasterfrom
semana-8-gabriel

Conversation

@brMonteiro-G
Copy link
Copy Markdown
Owner

No description provided.

@vercel
Copy link
Copy Markdown

vercel bot commented Jun 22, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
uptech-reviva-react ❌ Failed (Inspect) Jun 24, 2022 at 2:26PM (UTC)

Comment thread package.json
Comment on lines +13 to +19
"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",
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.

Comment thread src/Variables.ts
@@ -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 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.

<>
<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

@@ -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.

Comment on lines +25 to +28
<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>
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.

deveria ter removido os comentários.

<BoxModel data-id={index}>
<Link to={'/details/' + element.id}>
<DivImageButtons>
<ImageProducts
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.

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;
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.

poderia fazer destructuring direto.


export const buttonSizeState = atom<ButtonSize[]>({
key: 'buttonSizeState',
default: [{
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 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.

Comment on lines +3 to +6
export const cartTitlesState = atom<string[]>({
key: 'cartTitlesState',
default: ['Produto', 'Tamanho escolhido', 'Valor', 'Quantidade', 'Subtotal'],
});
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 também não deveria ser um estado, isso nunca vai mudar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants