Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
7bb16f8
feat: setup initial project
ElisonMichell Jan 11, 2023
ae2db10
feat(home):set overview as home page
ElisonMichell Jan 11, 2023
27de86c
feat(assets): add pokeball icons for light and dark mode
ElisonMichell Jan 11, 2023
5de8137
chore(dependencies): add phosphor-react@1.4.1
ElisonMichell Jan 11, 2023
240f931
chore: add custom babel config file
ElisonMichell Jan 11, 2023
1d8431f
style(theme): change primary color and default spacing
ElisonMichell Jan 11, 2023
55090fb
fix(assets): update svg files with a new logo
ElisonMichell Jan 11, 2023
531fccc
feat(components): add iconButton component
ElisonMichell Jan 11, 2023
fd6fdfa
feat(NavBar): add navigation bar component
ElisonMichell Jan 11, 2023
ff1013b
feat(components): add layout component
ElisonMichell Jan 11, 2023
27aa1e2
feat(app): add persistent layout component
ElisonMichell Jan 11, 2023
50703ab
style(theme): update with extended font and spacing sizes
ElisonMichell Jan 12, 2023
875b224
fix(IconButton): update styles sizes
ElisonMichell Jan 12, 2023
e5b9668
fix(Layout): add flex style to main element
ElisonMichell Jan 12, 2023
2ba2157
feat(components): add Box component
ElisonMichell Jan 12, 2023
d21d941
feat(components): add button component
ElisonMichell Jan 12, 2023
1f8fca6
chore(public): add public folder and banner video
ElisonMichell Jan 12, 2023
0097dd5
feat(components): add video banner component
ElisonMichell Jan 12, 2023
fd0677c
feat(overview): add new elements components to overview
ElisonMichell Jan 12, 2023
38ce25b
chore(dependencies): add axios@1.2.2
ElisonMichell Jan 12, 2023
de4ffa4
feat(context): add pokemon context for api requests
ElisonMichell Jan 12, 2023
ec5a36b
feat(app): wrap application with pokemon context provider
ElisonMichell Jan 12, 2023
a3b8b66
fix(styles): add label color, add missing dark type, change spacing a…
ElisonMichell Jan 12, 2023
fccbfcc
fix(box): add theme color to background
ElisonMichell Jan 12, 2023
56c2d66
fix(button): fix outdated spacing
ElisonMichell Jan 12, 2023
3d0f3fe
fix(iconButton): update outdated spacing
ElisonMichell Jan 12, 2023
e94bf1f
fix(layout): add overflow hidden to layout
ElisonMichell Jan 12, 2023
24bb6bb
fix(navigation bar): update outdated spacing
ElisonMichell Jan 12, 2023
856616f
fix(video banner): update outdated spacing
ElisonMichell Jan 12, 2023
4f6966a
feat(type label): add label component for pokemon types
ElisonMichell Jan 12, 2023
c55e152
chore(next config): add poke api to image configured host
ElisonMichell Jan 12, 2023
2adc0ef
feat(small card): add small pokemon card component
ElisonMichell Jan 12, 2023
8c589b5
fix(small card) update elements spacing and name size
ElisonMichell Jan 12, 2023
311a7b6
feat(button): add color prop to button background
ElisonMichell Jan 13, 2023
c900a02
style(box): update box style with a new border
ElisonMichell Jan 13, 2023
e70ec06
fix(video banner): add missing color prop on button
ElisonMichell Jan 13, 2023
f4035b9
style(small card): update header style
ElisonMichell Jan 13, 2023
cfc76dc
fix(global): fix button font with font-family
ElisonMichell Jan 13, 2023
9004eb7
style(theme): add new gray shades
ElisonMichell Jan 13, 2023
8889781
feat(context): add fetch pokemon description request
ElisonMichell Jan 13, 2023
d292a45
feat(components): add expanded card component
ElisonMichell Jan 13, 2023
1407ab8
feat(overview): add new card components and pokemon contex to overview
ElisonMichell Jan 13, 2023
f9d2d5b
fix(expanded card): add gap between name and types
ElisonMichell Jan 13, 2023
34a5bdb
refactor(layout): change overview header to application layout
ElisonMichell Jan 13, 2023
7074933
style(small card): update ring style
ElisonMichell Jan 13, 2023
ce07a30
style(layout): add capitalize text on layout header
ElisonMichell Jan 13, 2023
a3ae821
refactor(layout): subtitle hide when is not in overview page
ElisonMichell Jan 13, 2023
95828fa
feat(context): add pokemon list request
ElisonMichell Jan 13, 2023
626ad4f
feat(components): add card component for pokemon listing
ElisonMichell Jan 13, 2023
7c40f61
feat(pages): add pokemon listing on pokedex page
ElisonMichell Jan 13, 2023
1835daf
style(theme): update xl font size
ElisonMichell Jan 13, 2023
d7a0bdb
style(card): add hover effect
ElisonMichell Jan 13, 2023
1de830b
style(button): change hover color and add cursor pointer
ElisonMichell Jan 13, 2023
9fc31d5
feat(button): add onclick event
ElisonMichell Jan 13, 2023
a524ff6
style(card): add style on active state
ElisonMichell Jan 13, 2023
5bc9b76
feat(pokedex): add pagination button
ElisonMichell Jan 13, 2023
2cde0eb
feat(context): add per page pokemon list request
ElisonMichell Jan 13, 2023
383acb8
feat(components): add header component
ElisonMichell Jan 13, 2023
e0b5a78
refactor(pages): switch layout header to new header component
ElisonMichell Jan 13, 2023
6107998
fix(context): fix pokemon team initial size
ElisonMichell Jan 13, 2023
d3842e0
style(theme): switch theme colors pattern names and update the new co…
ElisonMichell Jan 13, 2023
58aa67b
refactor(icon button): delete component since it is no longer necessary
ElisonMichell Jan 13, 2023
3312411
fix(button): remove gap if button don't have a title
ElisonMichell Jan 13, 2023
52d0db0
style(input): add hover effect on search button
ElisonMichell Jan 13, 2023
771bb92
style(button): text align start if button has an icon
ElisonMichell Jan 13, 2023
3431d88
refactor(context): pokemon list is loaded completely on the first req…
ElisonMichell Jan 13, 2023
802e288
feat(navigation bar): add routes for buttons list
ElisonMichell Jan 13, 2023
876e861
chore(depedencies): add react-datalist-input@3.2.1
ElisonMichell Jan 14, 2023
de77ff7
style(button): add rounded prop to style button
ElisonMichell Jan 14, 2023
d4efa1c
style(cards): add padd start to cards id label
ElisonMichell Jan 14, 2023
8d29740
refactor(context): add reference list as provider value
ElisonMichell Jan 14, 2023
1e628bc
feat(input)!: add input with filter based on pokemon name
ElisonMichell Jan 14, 2023
e8b8797
refactor(input): remove unnecessary filters
ElisonMichell Jan 14, 2023
f433218
feat(components): add frame component for pokemon images
ElisonMichell Jan 14, 2023
dd40ee7
refactor(components): change card images to new frame component
ElisonMichell Jan 14, 2023
8e31f44
style(frame): update frame background to a solid color
ElisonMichell Jan 14, 2023
9c87f0a
refactor(context): minor update in request functions
ElisonMichell Jan 14, 2023
6249f52
feat(pokedex): pokemon cards redirects to a pokemon page
ElisonMichell Jan 14, 2023
dca51ea
feat(components)!: add an animated chart component
ElisonMichell Jan 15, 2023
eec6fc6
fix(nav bar): button get active state from pathname
ElisonMichell Jan 15, 2023
efe2f43
feat(context)!: add route context
ElisonMichell Jan 15, 2023
c43bc2b
feat(chart): finish chart functionalities
ElisonMichell Jan 15, 2023
97365bf
feat(components): add attributes box components for pokemon page
ElisonMichell Jan 15, 2023
3e0fe0f
fix(box): fix a bug which adds margin to all h3 child elements
ElisonMichell Jan 15, 2023
5a064a7
fix(chart): fix an issue that causes the bar to scale incorrectly
ElisonMichell Jan 15, 2023
187f250
fix(frame): fix an issue where the image does not center horizontally
ElisonMichell Jan 15, 2023
e48c4c1
refactor(context): add its own function to navigate the previous route
ElisonMichell Jan 15, 2023
73f4857
feat(header): update the function to return the route provided by the…
ElisonMichell Jan 15, 2023
2150a57
style(banner): update title name to pokemon universe
ElisonMichell Jan 15, 2023
aaa875b
refactor(pokemon context): reworks the responsibility of some functio…
ElisonMichell Jan 15, 2023
e88cd67
refactor(assets): move all files to public folder
ElisonMichell Jan 15, 2023
1ae6157
feat(pages): add custom page title
ElisonMichell Jan 15, 2023
f057ca6
feat(document): add icon and head elements
ElisonMichell Jan 15, 2023
9444dd5
feat(application)!: add add responsiveness
ElisonMichell Jan 15, 2023
7bd1caf
feat(context): add mobile menu open/closed state
ElisonMichell Jan 15, 2023
2e07653
chore(dependencies): add hamburguer-react@2.5.0
ElisonMichell Jan 15, 2023
3b53c04
feat(theme)!: add theme switcher
ElisonMichell Jan 16, 2023
a6cbf1f
refactor(icon): change icon size
ElisonMichell Jan 16, 2023
f7a9503
chore(pages): update page names
ElisonMichell Jan 16, 2023
18005be
fix(pages): config next to ignore pages styles
ElisonMichell Jan 16, 2023
243f762
chore: update readme
ElisonMichell Jan 16, 2023
21d8483
chore(readme): update setting up step
ElisonMichell Jan 16, 2023
7b3912d
docs: add license
ElisonMichell Jan 16, 2023
451383d
docs(readme): add license link
ElisonMichell Jan 16, 2023
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
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["next/babel"],
"plugins": [["styled-components", { "ssr": true }]]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Elison Michell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
117 changes: 85 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,102 @@
# **TESTE DE FRONTEND**
<a href="https://pokemon-universe-elisonmichell.vercel.app">

Neste teste, você será livre para criar uma aplicação consumindo a API que você quiser e com o tema que desejar.
Contudo, o seu projeto deverá seguir os requisitos mínimos de conteúdo.
![file cover - 1](https://user-images.githubusercontent.com/97061419/212690817-67ad2e1a-f067-4b43-9260-57a44f6e5421.png)
</a>

SUGESTÕES DE APIS:
https://github.com/public-apis/public-apis
<div align="center">
<img alt="GitHub repo size" src="https://img.shields.io/github/repo-size/ElisonMichell/pokemon-universe?color=FF2330&style=for-the-badge" />
<img alt="GitHub language count" src="https://img.shields.io/github/languages/count/ElisonMichell/pokemon-universe?color=FF2330&style=for-the-badge" />
<img alt="GitHub license" src="https://img.shields.io/github/license/ElisonMichell/pokemon-universe?color=FF2330&style=for-the-badge" />
<img alt="Status" src="https://img.shields.io/static/v1?label=Status&message=Complete&color=202028&style=for-the-badge" />
<a href="https://pokemon-universe-elisonmichell.vercel.app">
<img alt="Link" src="https://img.shields.io/static/v1?label=Access Page&message=Link&color=9BCC50&style=for-the-badge" />
</a>
</div>

---------------------------------------------------------------------
## REQUISITOS:
## 📚 About

## GIT
- Faça um fork deste repositório.
- Criar uma branch para codar as suas features.
- Criar um pull-request quando o teste for finalizado e submetido.
<p> 📌 Project developed for the technical test of Orma Carbon. </p>
<p>
Pokémon Universe is a pokedex made for listing pokémons using the PokéAPI to capture information about pokémons.
</p>

##### **NOTA: Será avaliado também se o nome da branch, títulos de commit, push e comentários possuem boa legibilidade.**
## 🌦 Orma Carbon

-----------------------------------------------------
- At Orma Carbon, innovative solutions are created for climate action, emissions compensation and access to the carbon market.
- Our solutions range from accessing our projects and credits, to portfolio creation and ESG instruments for purpose-built companies and investors.
- Real-time emissions calculation and offsetting within service and e-commerce platforms – affordable and convenient for users, at no cost to platforms.

Check out more about Orma Carbon's services <a href="https://www.orma.eco">here!</a>

## FRAMEWORK
## 📦 Features

- Utilizar as ferramentas presentes no framework do projeto (NEXT.JS).
- [x] Animated video as banner
- [x] Navigation menu
- [x] Pokémon search bar
- [x] Theme switching by context API
- [x] Listing with detailed information of each pokémon released
- [x] Interactive status chart
- [x] Fully responsive and mobile friendly website

-----------------------------------------------------
## 🛠 Tech Stack

## ESTILOS
- HTML5
- CSS3
- Javascript
- NextJS
- Styled Components
- Axios
- REST api
- Context api
- Phosphor icons

- Os estilos deste teste devem ser feitos em styled-components (evite utilizar bootstrap, mas se necessário, use).
- O projeto deverá conter tema claro/escuro e forma do usuário alterar entre os dois.
- Deve ser totalmente responsivo.
## 🎨 Gallery

-----------------------------------------------------
<div>

![localhost_3000_overview (15)](https://user-images.githubusercontent.com/97061419/212695415-a0e54028-6f40-4b74-b1bc-98ae36d7588c.png)
![localhost_3000_overview (3)](https://user-images.githubusercontent.com/97061419/212695697-7ba6145e-eb20-4e2b-b468-fec2e4b96139.png)
![localhost_3000_overview (6)](https://user-images.githubusercontent.com/97061419/212695793-25fc18fa-bd36-499d-99d0-3a0952cebeb4.png)
![localhost_3000_overview (13)](https://user-images.githubusercontent.com/97061419/212695588-71ab4eea-ffd0-4f58-8eda-3573af7d7c92.png)
![localhost_3000_overview (2)](https://user-images.githubusercontent.com/97061419/212696122-e89d63f5-d1e3-419d-8cf8-2d3055bb28cb.png)
![localhost_3000_overview (7)](https://user-images.githubusercontent.com/97061419/212696085-d9eb6fd0-f527-454e-a86e-6179f1fa8acd.png)

## PROJETO
</div>

- Deve utilizar useContext, useState e useEffect.
- Ter ao menos 3 paginas navegáveis com router (ex: um navbar para facilitar a navegação).
- Deve consumir uma API de sua escolha, desde que os dados sejam filtraveis e paginados. No mínimo 15 itens por requisição.
## 🚀 Getting Started

-------------------------------------------------------
<p>These instructions will get you a copy of the full project up and running on your local machine for development and testing purposes.</p>
<p>The project can be built with npm or yarn, so choose one of the approach bellow in case you don't have any installed on your system.</p>

## REQUISITOS DIFERENCIAIS:
- <a href="https://nodejs.org/en/download/">Node.js</a>
- <a href="https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable">Yarn</a>
- <a href="https://git-scm.com/downloads">Git</a>

- Código tentando seguir SOLID.
- Código performático.
- Utilizar inglês no projeto todo.
- Utilizar Injeção de Dependências.
- Fazer deploy do mesmo (heroku, netlify, aws, vercel, github pages ou outro da preferência).
## ⚙️ Setting up

```bash
# Clone this repository
$ git clone https://github.com/pokemon-universe.git

# Go into the repository
$ cd pokemon-universe

# Switch branch
$ git checkout pokedex-develop-branch

# Install dependencies
$ npm install

# start the application
$ npm run dev

# Now you have a copy of the project to modify and test in your editor.
```

## 📝 License

This project is under the MIT license. See the <a href="https://github.com/ElisonMichell/pokemon-universe/blob/pokedex-develop-branch/LICENSE">LICENSE</a> for more information.

##

Made with ♥ by Elison Michell 👋 <a href="https://www.linkedin.com/in/dev-elison-michell/">Get in touch!</a>
25 changes: 25 additions & 0 deletions components/AttributeBox/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react'
import TypeLabel from '../TypeLabel';
import { Container, Content, Types } from './styles'

function AttributeBox(props) {
return(
<Container className={props.className}>
<header><h3>Attributes</h3></header>
<Content>
<ul>
<li><b>Height:</b> {props.height / 10} m</li>
<li><b>Weight:</b> {props.weight / 10} kg</li>
</ul>
<Types>
{
props.types.map((item) => (
<TypeLabel key={item.type.name} type={item.type.name} />
))
}
</Types>
</Content>
</Container>
)
}
export default AttributeBox;
39 changes: 39 additions & 0 deletions components/AttributeBox/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import styled from 'styled-components'

export const Container = styled.div`
flex: 1;
display: flex;
flex-direction: column;
padding: ${(props) => props.theme.spacing.md};
border: 1px solid ${(props) => props.theme.colors.border};
border-radius: ${(props) => props.theme.spacing.md};
transition: background 0.3s, color 0.3s, border 0.3s;
color: ${props => props.theme.colors.text}

h3 {
margin-bottom: ${(props) => props.theme.spacing.lg};
}

li {
list-style: none;
}

ul {
display: flex;
flex-direction: column;
gap: ${(props) => props.theme.spacing.xs};
}
`
export const Content = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
`

export const Types = styled.div`
display: flex;
height: 100%;
flex-direction: column;
justify-content: flex-end;
gap: ${(props) => props.theme.spacing.sm};
`
17 changes: 17 additions & 0 deletions components/Box/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react'
import { Container } from './styles'

function Box({title, children}) {
return(
<Container>
{title &&
<header className='title'>
<h3>{title}</h3>
</header>
}

{children}
</Container>
)
}
export default Box;
23 changes: 23 additions & 0 deletions components/Box/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import styled from 'styled-components'

export const Container = styled.section`
flex: 1;
display: flex;
flex-direction: column;
background: ${props => props.theme.colors.text+10};
padding: ${props => props.theme.spacing.xl};
border-radius: ${props => props.theme.spacing.xl};
border: 1px solid ${ props => props.theme.colors.border};
transition: background 0.3s, color 0.3s, border 0.3s;

.title {
font-size: ${props => props.theme.fonts.size.lg};
font-weight: 600;
margin-bottom: ${props => props.theme.spacing.lg};
color: ${props => props.theme.colors.text};
}

@media (max-width: ${props => props.theme.breakpoints.sm}) {
padding: ${props => props.theme.spacing.xl} ${props => props.theme.spacing.lg} ${props => props.theme.spacing.lg};
}
`
12 changes: 12 additions & 0 deletions components/Button/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react'
import { Container } from './styles'

function Button(props) {
return(
<Container {...props}>
{props.icon}
<span>{props.title}</span>
</Container>
)
}
export default Button;
43 changes: 43 additions & 0 deletions components/Button/styles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import styled from "styled-components";

export const Container = styled.button`
display: flex;
align-items: center;
gap: ${props => (props.title && props.icon) && props.theme.spacing.md};
width: ${props => props.flex ? '100%' : 'max-content'};
min-width: ${props => !props.icon && '10rem'};
border-radius: ${props => (props.rounded && '50%') || props.theme.spacing.md};
padding: ${props => props.theme.spacing[props.size] || props.theme.spacing.md};
font-size: ${props => props.theme.fonts.size.md};
font-weight: 600;
cursor: pointer;

color: ${
props => props => (props.active &&
props.theme.colors.white) ||
props.theme.colors[props.textColor] ||
props.theme.colors.text};

background: ${
props => props.active ?
props.theme.colors[props.activeColor] ||
props.theme.colors.primary100 :
props.theme.colors[props.color] ||
props.theme.colors.primary200
};
transition: background 0.3s, color 0.3s;

span {
text-align: ${props => props.icon && 'start'};
flex:1;
}

:hover {
background: ${ props => !props.active && (props.theme.colors[props.hoverColor] || props.theme.colors.text+20) };
}

:disabled {
pointer-events: none;
filter: opacity(0.5);
}
`
37 changes: 37 additions & 0 deletions components/Card/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import React, { useContext } from "react";
import { Container, Content, Header, Types } from "./styles";
import { RouteContext } from "../../context/routeContext";

import TypeLabel from "../TypeLabel";
import Frame from "../Frame";

function Card(props) {
const { toPokemonLink } = useContext(RouteContext);

return (
<Container active={props.active} onClick={() => toPokemonLink(props.name)}>
{props.sprite && (
<Frame
src={props.sprite}
alt={props.name + " Sprite"}
width={360}
height={360}
priority
/>
)}
<Content>
<Header>
<div>Nº&nbsp;{props.id.toString().padStart(3, "0")}</div>
<span>{props.name}</span>
</Header>
<Types>
{props.type &&
props.type.map((type, id) => (
<TypeLabel key={type} type={props.type[id]} />
))}
</Types>
</Content>
</Container>
);
}
export default Card;
Loading