Skip to content

ellacmd/movieapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Entertainment web app solution

This is a solution to the Entertainment web app challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic project.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the app depending on their device's screen size
  • See hover states for all interactive elements on the page
  • Navigate between Home, Movies, TV Series, and Bookmarked Shows pages
  • Add/Remove bookmarks from all movies and TV series
  • Search for relevant shows on all pages

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • CSS Grid
  • React
  • React-router dom for routing
  • Custom react hooks

What I learned

I needed a reuseable function that sets State in different components so I learned to use custom hooks.

import { useState } from 'react';

export const useSearch = (movieData) => {
  const [searchQuery, setSearchQuery] = useState('');
  const [searchResult, setSearchResult] = useState([]);

  const searchHandler = (e) => {
    const typedInput = e.target.value;
    // updates the input
    setSearchQuery(typedInput);
    // do the logic
    const query = typedInput.trim().toLowerCase();

    const searchResults = movieData?.filter((movie) =>
      movie.title.toLowerCase().includes(query)
    );
    setSearchResult(searchResults);
  };

  return { searchResult, searchQuery, searchHandler };
};

};

Author

About

A Frontend mentor movie app challenge built with ReactJs that fetches data from a local json file. Users can search for and bookmark movies. Movies are also sorted by categories

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors