Code Monkey home page Code Monkey logo

project-movies's Introduction

Movies fetched from an API

In this project I created a multi-paged website using React Router. Movies are fetched from different API endpoints.

The problem

I started writing the different routes I wanted to have and making the structure in App.js. I then created the component 'MovieList' to fetch the API with movies Now playing. The information gotten are then sent to another component 'MovieThumb' that picks out the data I want to show from the API on my page.

Next I created the page 'MovieDetail' using params to get to the right site for each movie. On this page I fetch details for the particular movie clicked on in the Movie list. In each detailed movie page it is possible to click on a link to get back to the home page.

The hardest part was the styling of both the first page and the detailed page where different elements where to be put above each other. Here I learned new ways ot use CSS, by making element visible and not.

I added a component for page 'Not Found' when the users hits an URL that doesn't relate to a movie in the API. There is thousands of movies to quite hard to hit a 'wrong' url..

I did also add a Header text and a Navigation bar. Here I linked more components fetching Movies from other endpoints, like Top Rated Movies and Upcoming Movies. I the navbar it is possible to see which list you are showing currently and it is also possible to click among the different movie lists. In the end I added movies by Theme where I learned to add a element to choose among different themes that fetches different URL's. For me it was really fun using React router to finally be able to create multi-paged websites. For me that is more useful since in most cases that is how webpages work. Right now I just want to create a lot of pages connecting in the App file to really make it multi-paged. Learning Objectives Using React router to create multi-page webpages Use placeholders in url's to pick dynamic parts from url's Using API's in React combining 'useState' with 'useEffect' Tech Tech React JS CSS View it live Link to see the webpage live: https://movieslists.netlify.app/

project-movies's People

Contributors

gabbi-89 avatar idlefingers avatar emolsz avatar dependabot[bot] avatar jenniedalgren avatar puj 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.