german-bortoli / pokedex-cc

Pokemon explorer

Home Page:https://dreamy-pithivier-c367b9.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pokedex

Pokedex code challenge

Project Links

Note: If you want to see another storybook branch, please change main from the URL to the branch that you want.

Tech stack decisions

  • Typescript with CRA.
  • Storybooks with chromatic to test and review graphic changes.
  • Use unit tests as much as possible.
  • Use react-hooks and contexts avoiding redux.
  • Be a11y (accessiblity) compliant.

Pokemon Listing

The screen to list pokemons has the following features:

  • Pokemons per page selector.
  • Pokemon Cards (name and avatar).
  • Pagination.

When clicking a pokemon card will trigger the pokemon profile modal box.

Pokemon Profile

At the moment I'm fetching all the moves and abilities at the same time, ideally it would be nice to add some pagination fetching just a few of them and also add better condensed design.

The profile shows the following information:

  • Small avatar, pokemon name.
  • Big avatar
  • Height, Weight, Base Experience and Order.
  • Moves and Abilities.

Dev: To implement this feature, it was used a react context, so you can open any pokemon profile by his name into the whole app, and a modal will popup with show up. To use please import the PokemonProfileProvider into your App and use the code below.

// Import the context
import { usePokemonProfile } from '../contexts';

// Get show pokemon profile hook,
const { showPokemonProfile } = usePokemonProfile();

// Show pokemon profile popup
showPokemonProfile('charizard');

Add Pokemon

Created a react context to display a modal box with the following form:

  • Name
  • Height, Weight, Base Experience and Order.
  • Abilitites, Moves, Types and Items (with images) as autocomplete and showing chips.
  • Image dropzone.

When clicking the "Plus Icon" on the bottom-right corner from the app the modal box will appear.

Environment setup

Clone this project and into the root path execute npm install

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

About

Pokemon explorer

https://dreamy-pithivier-c367b9.netlify.app/


Languages

Language:TypeScript 99.5%Language:HTML 0.4%Language:JavaScript 0.1%Language:CSS 0.0%