Skip to content

Conversation

@amotor95
Copy link

Summary

Reorganized components to each have their own folder with their jsx and css
Refactored api calls into apiUtils in utils folder
Refactored sorting methods into sortingUtils in utils folder

Testing

Tested search, sorting, favorites, watched, and movie modal components to ensure functionality after refactoring (components that use API calls and sorting in utils) ✅
image
image
image

Jack McClure and others added 30 commits June 10, 2025 14:47
- Rename fetchMovieList() to fetchAndProcessMoviesByIDList() for clarity
- Split fetchAndProcessMoviesByIDList() into fetchMovieByID() and processMoviesByID()
- Rename fetchSearchMovies() to fetchAndProcessMoviesBySearch() for clarity
- Split fetchAndProcessMoviesBySearch into buildMovieSearchURL(), fetchMoviesBySearch(), and processMoviesBySearch()
- Refactor sortMovies() to sortMovieOrder() for clarity and replace if/else with switch/case for readability
- Update useEffect dependencies [mode, pageCleared] to use switch/case for readability
These changes improve code readability and maintainability by clarifying function purposes and enhancing control flow readability.
…ishing

Refactoring Movie Fetch Functions and Sorting
… favorites/watched and then back with text in searchText
…}, moved modal component to movielist component
fix - removed testing console logs
fix - renamed promises to moviePromises for readability
…ishing

Jackmccl/flixster/styling and polishing
…ishing

Fixed minimum movie card width to 90px
Jack McClure and others added 2 commits June 13, 2025 11:44
…or jsx and css

Fix - sorting mode now resets when swapping to favorites or watched
Jackmccl/file reorg
Fixing sidebar sort mode bug
moved api and sorting to utils
Comment on lines +4 to +11
:root {
--lucida-font: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
--steelgray: #1e1e2f;
--martinique: #2a2a4c;
--butterflybush: #505091;
--wildblueyonder: #8080bc;
--gallery: #f0f0f0;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice use of css variables here!

@@ -0,0 +1,66 @@
export const fetchMovieByID = async (movieID) => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work organizing helper functions into a util to reduce code clutter :)

// Takes a list of movie entries (a list of {id: int, movie: {}}) and sorts by vote average property (highest to lowest)
export const movieEntriesVoteAverageSort = (movieEntries) => {
movieEntries.sort((left_entry, right_entry) => {
return right_entry[1].vote_average-left_entry[1].vote_average
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice and concise :)

@B1gO
Copy link

B1gO commented Jun 18, 2025

LGTM

Copy link

@auroraw9825 auroraw9825 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work!
Definitely see very big improvement on code quality, thanks for following up on our comments and you learn so fast!

const data = await response.json()
return data
} catch (error) {
console.error(error)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq" when there is an error fetching movies, is it a blank page?

let response = null
response = await fetch(`https://api.themoviedb.org/3/movie/${movieID}/videos?language=en-US`, options)
if (!response.ok) {
throw new Error('Failed to fetch videos')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question here: wondering what the behavior is when fetching is failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants