Open
Conversation
added 3 commits
June 10, 2024 19:20
TLDR: Add movie info from API Create elements with React and make GET request to IMDB API. Returns movies now showing in theaters.
tldr: add more info from additional api request Added button at bottom of page that when pressed loads in 20 more movies. This is done by updating the page in fetch to api. it is able to load in as many times as is pressed.
akhilmandadi
suggested changes
Jun 12, 2024
src/MovieList.css
Outdated
| padding: 20px; | ||
| width: 75%; | ||
| margin: 0 auto; | ||
|
|
There was a problem hiding this comment.
minor: use format to eliminate empty lines.
src/MovieList.jsx
Outdated
| /> | ||
| )) | ||
| ) : ( | ||
| <p>Loading movies...</p> //error handle if data length == 0 |
There was a problem hiding this comment.
Can probably say "No Movies found instead"
src/MovieList.jsx
Outdated
| }; | ||
|
|
||
| const resetPage = () => { | ||
| console.log("resetPage"); |
src/MovieList.jsx
Outdated
| }; | ||
| useEffect(() => { | ||
| fetchData(); | ||
| }, [page]); //adds to update for every new page |
There was a problem hiding this comment.
Can probably remove page from this dependency array, as we are calling API once page is changed.
src/MovieList.jsx
Outdated
| `https://api.themoviedb.org/3/movie/now_playing?language=en-US&page=${page}`, | ||
| options | ||
| ); //fills link | ||
| const Data = await resp.json(); |
There was a problem hiding this comment.
name it data or moviesList instead?
|
|
||
| const searchMovies = () => { | ||
| updatePage(1); | ||
| setData([]); |
There was a problem hiding this comment.
Might not need this as data is being set in the fetchData function anyway
added 12 commits
June 12, 2024 13:37
things I added- 1. Creating modal element that covers screen 2. input element from API 3. create on click events for modal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Made the following changes:
code and image of output-

