Giter VIP home page Giter VIP logo

pokemon-api-challenge's Introduction

Pokédex - Pokémon API Challenge - built with React

This is a responsive Single Page Application built using React and Styled Components that consumes an API. The project was built in response to a challenge proposed by the fullstack web development course Devquest by Dev em Dobro.

Overview

The project

The application provides a list of Pokémons. In order to see more Pokémons, user can click on "Load more" and new Pokémons are added to the list. By clicking on a Pokémon, user can see it's details such as moves, abilities and types. It is also possible to sort Pokémons by type or search by name. If an invalid name is entered, an error message appears on screen.

Preview

Desktop

gif of project being displayed and used on desktop

Tablet

gif showing project on tablet

Mobile

gif of project displayed on mobile

How to use the project

  • Clone the project:
  • Option 1: git clone
    • Open the folder in your computer where you want to store the project;
    • Open terminal in this folder;
    • Paste the following command in the terminal and hit enter:
      git clone https://github.com/julianastahelin/pokemon-api-challenge.git
    • Once it is done running, enter the project folder created:
      cd pokemon-api-challenge
    Option 2: download files
    • Click on "Clone" and then on "Download ZIP";
    • Open folder in your computer and click to Extract all files;
    • Open folder with files extracted and open the terminal inside that folder.
  • Then, enter the following command to install the project dependencies:
    npm install
  • Then, start the application in the local server:
    npm start
  • Open folder in the text editor of your choice.

Links

My process

Built with 👩🏽‍💻

  • React.js;
  • Styled components;
  • CSS.

Tools used and technical decisions

  • React-icons: I chose to use react-icons because it has a wide range of icon libraries, it is easy to install and use and I can only import the icons that will be used.
  • useNavigate hook from react-router-dom: used to navigate to a new route when sort by type component has an option selected; it is a tool I found to connect one component to another using the hook and changing the url at the same time. The "Choose..." option (which is equivalent to removing the filter), I've set to navigate to the homepage, where all types are displayed by default, and there is no need for a unique url. In this case, since I couldn't figure out how to pass on the string 'pokemon' from the filter component's state as a prop to the homepage route, but only as part of the path, I decided to use an if-else statement in the pokémon list component to check if the string passed on is undefined, which happens when 'Choose...' option is selected. If so, it changes to 'pokemon' and all types are rendered.

What I practiced 💪🏽

  • Building React components;
  • Using React hooks: useState, useEffect, useContext, useRef;
  • Using Context API;
  • Fetching data from an API;
  • Using React Router to build the routes in the Single Page Application;
  • Styling with Styled components;
  • Passing parameters from parent to child and from child to parent components;
  • Using Icons in React.

pokemon-api-challenge's People

Contributors

julianastahelin avatar

Stargazers

Rillian Diello avatar Caroline Cobucci avatar Vanderlei Geronimo Junior avatar Arthur Henrique avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.