Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
21378c0
feita a configuração inicial
A97Campos Oct 4, 2024
e28a787
Criação do Header
A97Campos Oct 8, 2024
a61a375
criação do banner
A97Campos Oct 9, 2024
fcfcb36
criação dos Cards
A97Campos Oct 14, 2024
0e6ea84
construção de páginas
A97Campos Oct 17, 2024
51ea018
adicionando o footer
A97Campos Oct 17, 2024
be3ce12
melhorias na responsividade
A97Campos Oct 18, 2024
0ad27fd
Criação do Hero da página product
A97Campos Oct 28, 2024
bab5bf4
criada a section de galeria
A97Campos Nov 5, 2024
ce012df
atualizando a galeria
A97Campos Nov 6, 2024
2a97597
criação do modal
A97Campos Nov 6, 2024
4c99850
conclusão do modal
A97Campos Nov 8, 2024
c6b5641
conclusão da integração com api parte 1
A97Campos Nov 13, 2024
4ff9903
final da parte 2 do projeto 6
A97Campos Nov 21, 2024
5ab72ef
update api
A97Campos Dec 19, 2024
16c8b3c
começando a criação do carrinho
A97Campos Dec 21, 2024
422bd26
concluindo o carrinho
A97Campos Dec 23, 2024
5871c71
estilização do botão excluir do carrinho
A97Campos Dec 24, 2024
4f9871e
conclusão da abertura e fechamento do carinho
A97Campos Dec 24, 2024
af30d09
conclusão do carrinho
A97Campos Dec 27, 2024
2b54a41
finalização do carrinho
A97Campos Dec 28, 2024
c09a6d4
criação da página chekout
A97Campos Jan 9, 2025
61b7610
criando a seção de pagamento
A97Campos Jan 11, 2025
5758b41
aplicando validações no formulário
A97Campos Jan 14, 2025
d459bfe
criação do menu responsivo
A97Campos Jan 15, 2025
56ca607
Update Api
A97Campos Jan 15, 2025
c949e5d
aplicando melhorias no projeto
A97Campos Jan 16, 2025
e5324ef
aplicando melhorias no código
A97Campos Jan 20, 2025
ff98c54
validando o checkout
A97Campos Jan 23, 2025
db50f0f
adicionando loaders
A97Campos Jan 23, 2025
be80bc5
Update api.ts
A97Campos Aug 25, 2025
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 .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"source.fixAll.eslint": "explicit"
}
}
418 changes: 387 additions & 31 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,26 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@reduxjs/toolkit": "^2.5.0",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.23",
"@types/react": "^18.0.31",
"@types/react-dom": "^18.0.11",
"formik": "^2.4.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^9.2.0",
"react-router-dom": "^6.26.2",
"react-router-hash-link": "^2.4.3",
"react-scripts": "5.0.1",
"react-spinners": "^0.15.0",
"styled-components": "^6.1.13",
"typescript": "^4.9.5",
"web-vitals": "^2.1.4"
"web-vitals": "^2.1.4",
"yup": "^1.6.1"
},
"scripts": {
"start": "react-scripts start",
Expand All @@ -41,6 +49,7 @@
]
},
"devDependencies": {
"@types/react-router-hash-link": "^2.4.9",
"@types/styled-components": "^5.1.26",
"@typescript-eslint/eslint-plugin": "^5.53.0",
"@typescript-eslint/parser": "^5.53.0",
Expand Down
3 changes: 3 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet">
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
38 changes: 0 additions & 38 deletions src/App.css

This file was deleted.

42 changes: 23 additions & 19 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
import React from 'react'
import logo from './logo.svg'
import './App.css'
import { Provider } from 'react-redux'
import { BrowserRouter } from 'react-router-dom'

import { Header } from './components/Header'
import { GlobalCss } from './styles'

import { Rotas } from './routes'
import { Footer } from './components/Footer'
import { store } from './store'
import { Cart } from './components/Cart'

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.tsx</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
<Provider store={store}>
<div className="App">
<BrowserRouter>
<GlobalCss />
<div className="container">
<Header />
</div>
<Rotas />
<Footer />
<Cart />
</BrowserRouter>
</div>
</Provider>
)
}

Expand Down
Binary file not shown.
Binary file added src/assets/images/banner-homem-aranha.png
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 src/assets/images/barcode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/assets/images/carrinho.svg
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 src/assets/images/credit-card.png
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 src/assets/images/diablo.png
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 src/assets/images/fechar.png
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 src/assets/images/fifa.png
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 src/assets/images/fundo_hogwarts.png
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 src/assets/images/image_hogwarts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/assets/images/logo.svg
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 src/assets/images/play.png
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 src/assets/images/resident.png
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 src/assets/images/star_wars.png
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 src/assets/images/streetFighter.png
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 src/assets/images/zelda.png
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 src/assets/images/zoom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions src/components/Banner/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Tags } from '../Tags'
import { Button } from '../Button'
import { parseToBrl } from '../../utils'
import { Loader } from '../Loader'

import { useGetFeaturedGameQuery } from '../../services/api'

import * as S from './style'

export const Banner = () => {
const { data: game } = useGetFeaturedGameQuery()

if (!game) {
return <Loader />
}

return (
<S.Image style={{ backgroundImage: `url(${game.media.cover})` }}>
<div className="container">
<Tags size="big">Destaque do dia</Tags>
<div>
<S.Title>{game.name}</S.Title>
<S.Price>
De <span>{parseToBrl(game?.prices.old)}</span>
<br />
por apenas {parseToBrl(game?.prices.discount)}
</S.Price>
</div>
<Button
type="link"
to={`/product/${game.id}`}
title="clique para aproveitar a oferta"
>
Aproveitar
</Button>
</div>
</S.Image>
)
}
51 changes: 51 additions & 0 deletions src/components/Banner/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import styled from 'styled-components'
import { TagsContainer } from '../Tags/style'

export const Image = styled.div`
width: 100%;
height: 560px;
padding: 32px 0 56px 0;
display: block;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: relative;

.container {
position: relative;
padding-top: 340px;
max-height: 100%;
display: flex;
justify-content: space-between;
align-items: flex-end;
z-index: 1;
}

${TagsContainer} {
position: absolute;
top: 0;
}

&::after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
content: '';
}
`

export const Title = styled.h2`
font-size: 32px;
max-width: 450px;
`

export const Price = styled.p`
font-size: 24px;
margin-top: 24px;
span {
text-decoration: line-through;
}
`
38 changes: 38 additions & 0 deletions src/components/Button/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { ButtonContainer, ButtonLink } from './style'

export type Props = {
type: 'button' | 'link' | 'submit'
title: string
to?: string
onClick?: () => void
children: string
variant?: 'primary' | 'secundary'
}

export const Button = ({
type,
title,
to,
onClick,
children,
variant = 'primary'
}: Props) => {
if (type === 'button' || type === 'submit') {
return (
<ButtonContainer
variant={variant}
type={type}
title={title}
onClick={onClick}
>
{children}
</ButtonContainer>
)
}

return (
<ButtonLink to={to as string} title={title}>
{children}
</ButtonLink>
)
}
27 changes: 27 additions & 0 deletions src/components/Button/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import styled from 'styled-components'
import { colors } from '../../styles'
import { Link } from 'react-router-dom'
import { Props } from '.'

export const ButtonContainer = styled.button<Props>`
border: 2px solid
${(props) => (props.variant === 'primary' ? colors.green : colors.white)};
color: ${colors.white};
border-radius: 8px;
background: ${(props) =>
props.variant === 'primary' ? colors.green : 'transparent'};
padding: 8px 16px;
font-size: 16px;
font-weight: bold;
cursor: pointer;
`

export const ButtonLink = styled(Link)`
border: 2px solid ${colors.white};
color: ${colors.white};
border-radius: 8px;
background: transparent;
padding: 8px 16px;
font-size: 16px;
font-weight: bold;
`
15 changes: 15 additions & 0 deletions src/components/Card/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Container } from './style'

type Props = {
children: JSX.Element
title: string
}

export const Card = ({ children, title }: Props) => {
return (
<Container>
<h2>{title}</h2>
{children}
</Container>
)
}
30 changes: 30 additions & 0 deletions src/components/Card/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import styled from 'styled-components'
import { colors } from '../../styles'

export const Container = styled.div`
border-radius: 8px;
background-color: ${colors.gray};
padding: 24px;
margin-bottom: 40px;

h2,
h3 {
font-size: 18px;
font-weight: 700;
color: ${colors.white};
margin-bottom: 24px;
}

h3 {
margin-top: 24px;
}

p {
font-size: 14px;
line-height: 22px;
}

.margin-top {
margin-top: 16px;
}
`
Loading