-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wen's movie site #51
Open
wwenzz
wants to merge
34
commits into
Technigo:main
Choose a base branch
from
wwenzz:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Wen's movie site #51
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
1f32dbf
Create folder and component structure
wwenzz 32ad85b
Fetch data of movies
wwenzz ac70c2f
Create category component for chossing different list types
wwenzz feba2ec
Create pagination component
wwenzz 43ad366
Add navigate component to index route
wwenzz 84da263
Style the display on movieList component
wwenzz a1845b0
Connect movie detail to movie list and create movie detail component
wwenzz 845a74f
Apply overlay to movies
wwenzz 0532dcd
Style the movie detail page
wwenzz 7758411
Merge branch 'Technigo:main' into main
wwenzz 292cfb6
Move category and pagination components to MovieList and control the …
wwenzz 86b6e81
Make category active based on the selection
wwenzz ac1af1c
Set the loading state on Movie and List pages. Also style the h1
wwenzz f82c2e1
Create go back component and stying
wwenzz 2140a5c
Style the pagination and category filter
wwenzz b203d46
Add the loading state and make page changes scroll to top
wwenzz 6459fcd
Add lottie animation for loading status on Movie List page
wwenzz 93028d3
Add loading animation for Movie Detail page
wwenzz 53f8e21
Style the loading animation for movie page
wwenzz f8ce7a6
Implement error handling on page not found and movie data not found
wwenzz 338a428
Make responsiveness on category and movie list
wwenzz c1de5e2
Use map function on pagination component
wwenzz a73a6d2
Make responsiveness on movie detail component
wwenzz 7ed6539
Adjust the html, body and root to fit 100% height
wwenzz 8649ca7
Create component for lazy loading images
wwenzz 32b47c5
Add placeholder to load image component
wwenzz 09d53b2
Remove comments in CSS files
wwenzz 82e9965
Remove comments in component files and implement error handling on Mo…
wwenzz 54771d9
Add propTypes to components
wwenzz 1ffd13e
Create env and deployment toml file
wwenzz 0ad0d10
Update readme
wwenzz d36d420
Remove console log
wwenzz 50f8dee
Add background color to the body
wwenzz 336020d
Update LoadImage.jsx
wwenzz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ dist | |
dist-ssr | ||
*.local | ||
package-lock.json | ||
.env | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,23 @@ | ||
<h1 align="center"> | ||
<a href=""> | ||
<img src="/src/assets/movies.svg" alt="Project Banner Image"> | ||
</a> | ||
</h1> | ||
<img src="/src/assets/finished-version.png" alt="Project thumbnail"> | ||
|
||
# Movie Site Project | ||
|
||
Replace this readme with your own information about your project. | ||
This project is built around React Router and get utlise the useParams hook, Link and NavLink components. The website has 3 pages: | ||
|
||
Start by briefly describing the assignment in a sentence or two. Keep it short and to the point. | ||
- Homepage: including movie list and each movie links to movie detail page; | ||
- Not Found Page; | ||
- Movie Detail Page | ||
|
||
## Getting Started with the Project | ||
Moreover I used query parameters to display clearly which list category and page the movie list is about. And then use the useSearchParams in other components. | ||
|
||
### Dependency Installation & Startup Development Server | ||
# The Problem | ||
|
||
Once cloned, navigate to the project's root directory and this project uses npm (Node Package Manager) to manage its dependencies. | ||
- API call: Access Token is used in the header section instead of the query params to make API call more secure. | ||
- Nested Routes: By implementing nested routes and using outlet component to insert route, it makes the route relationship clearer. | ||
- Query Params and params: This project uses both query params and params for components/pages detecting URL changes and using the params in the component building. | ||
- NavLink, Link and useNavigate: This takes some time to differentiate in terms of when to use and what properties they have. NavLink is used in the category bar and pagination where the active class is needed for styling. Whereas Link is used in normal situation. Lastly, useNavigate hook is implemented on some onClick functions or divs. | ||
- Lazy Loading: LoadImage component does all the lazy loading for images. It observes the part of the viewport the user is on and render the images accordingly. It saves the loading work under the hood and enhances the performance. | ||
|
||
The command below is a combination of installing dependencies, opening up the project on VS Code and it will run a development server on your terminal. | ||
# View it live | ||
|
||
```bash | ||
npm i && code . && npm run dev | ||
``` | ||
|
||
### The Problem | ||
|
||
Describe how you approached to problem, and what tools and techniques you used to solve it. How did you plan? What technologies did you use? If you had more time, what would be next? | ||
|
||
### View it live | ||
|
||
Every project should be deployed somewhere. Be sure to include the link to the deployed project so that the viewer can click around and see what it's all about. | ||
|
||
## Instructions | ||
|
||
<a href="instructions.md"> | ||
See instructions of this project | ||
</a> | ||
[![Netlify Status](https://api.netlify.com/api/v1/badges/0de75402-1a29-48c8-988d-93e98f843d46/deploy-status)](https://app.netlify.com/sites/popcorn-movie-hub/deploys) |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[[redirects]] | ||
from= "/*" | ||
to = "/index.html" | ||
status = 200 |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
import Home from "./pages/Home"; | ||
import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom"; | ||
import MovieList from "./components/MovieList"; | ||
import Movie from "./pages/Movie"; | ||
import PageNotFound from "./pages/PageNotFound"; | ||
|
||
export const App = () => { | ||
return <div>Find me in src/app.jsx!</div>; | ||
return ( | ||
<BrowserRouter> | ||
<Routes> | ||
<Route path="/" element={<Home />}> | ||
<Route index element={<Navigate replace to="browser" />} /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool that you use navigate here. We didn't do that. Great inspiration! |
||
<Route path="browser" element={<MovieList />} /> | ||
</Route> | ||
<Route path="/movies/:movieID" element={<Movie />} /> | ||
<Route path="*" element={<PageNotFound />} /> | ||
</Routes> | ||
</BrowserRouter> | ||
); | ||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"v":"5.5.10","fr":29.9700012207031,"ip":0,"op":75.0000030548126,"w":300,"h":335,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 6","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":25,"s":[148,190.571,0],"to":[0,1.667,0],"ti":[0,-1.667,0]},{"t":32.0000013033867,"s":[148,200.571,0]}],"ix":2},"a":{"a":0,"k":[0,31.75,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":25,"s":[0,0,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":32,"s":[119.25,136.286,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":34,"s":[86,98.286,100]},{"t":36.0000014663101,"s":[100,114.286,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[20,20],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,40.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":25.0000010182709,"op":372.000015151871,"st":-6.00000024438501,"bm":0,"completed":true},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 5","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[149,187.5,0],"ix":2},"a":{"a":0,"k":[0,78.156,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":19,"s":[52.459,2.459,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":27,"s":[52.459,61.459,100]},{"i":{"x":[0.833,0.833,0.833],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0,0,0]},"t":30.5,"s":[52.459,45.459,100]},{"t":34.0000013848484,"s":[52.459,52.459,100]}],"ix":6}},"ao":0,"hasMask":true,"masksProperties":[{"inv":false,"mode":"f","pt":{"a":0,"k":{"i":[[6.4719999999999995,87.33200000000001],[31.495,1.2890000000000015],[-30.587,-86.32900000000001],[-14.211,59.012]],"o":[[14.273,60.728],[31.587,-86.57],[-30.587,1.051000000000002],[-5.564000000000001,87.57000000000001]],"v":[[10.277,74.31],[31.587,-36.638],[-30.587,-36.638],[-9.624,74.31]],"c":true},"ix":1},"o":{"a":0,"k":100,"ix":3},"x":{"a":0,"k":0,"ix":4},"nm":"Mask 1"}],"shapes":[{"ty":"gr","it":[{"ty":"rc","d":1,"s":{"a":0,"k":[234,260],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"r":{"a":0,"k":0,"ix":4},"nm":"Rectangle Path 1","mn":"ADBE Vector Shape - Rect","hd":false},{"ty":"fl","c":{"a":0,"k":[1,1,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[5,1.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Rectangle 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":19.0000007738859,"op":374.000015233332,"st":-4.00000016292334,"bm":0,"completed":true},{"ddd":0,"ind":5,"ty":4,"nm":"Shape Layer 3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[150,167,0],"ix":2},"a":{"a":0,"k":[-4,-8.5,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.471,0.471,0.667],"y":[1,1,1]},"o":{"x":[0.48,0.48,0.333],"y":[0,0,0]},"t":7,"s":[0,0,100]},{"t":25.0000010182709,"s":[78.151,78.151,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[238,238],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.9569,0.7451,0.7451,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-4,-8.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":7.00000028511585,"op":385.000015681372,"st":7.00000028511585,"bm":0,"completed":true},{"ddd":0,"ind":6,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":20,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[150,167,0],"ix":2},"a":{"a":0,"k":[-4,-8.5,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.471,0.471,0.667],"y":[1,1,1]},"o":{"x":[0.48,0.48,0.333],"y":[0,0,0]},"t":3,"s":[0,0,100]},{"t":21.0000008553475,"s":[96.639,96.639,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[238,238],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.9569,0.7451,0.7451,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-4,-8.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":3.00000012219251,"op":381.000015518448,"st":3.00000012219251,"bm":0,"completed":true},{"ddd":0,"ind":7,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":10,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[150,167,0],"ix":2},"a":{"a":0,"k":[-4,-8.5,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.471,0.471,0.667],"y":[1,1,1]},"o":{"x":[0.48,0.48,0.333],"y":[0,0,0]},"t":0,"s":[0,0,100]},{"t":18.000000733155,"s":[110.084,110.084,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[238,238],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false,"_render":true},{"ty":"fl","c":{"a":0,"k":[0.9569,0.7451,0.7451,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false,"_render":true},{"ty":"tr","p":{"a":0,"k":[-4,-8.5],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform","_render":true}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false,"_render":true}],"ip":0,"op":378.000015396256,"st":0,"bm":0,"completed":true}],"markers":[{"tm":40.0000016292334,"cm":"","dr":0}],"__complete":true} |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice Popcorn Icon 🍿 !
//Martin, Linda