-
Notifications
You must be signed in to change notification settings - Fork 417
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
https://master--musical-florentine-5987b8.netlify.app/ #316
base: master
Are you sure you want to change the base?
Changes from all commits
f39a8e3
abaa401
d3491fd
acadc4a
2bd1269
7c07973
fe5cf29
c5409ff
ee8a171
b64c9cf
40e8ef6
ec4c810
a676731
77a3e75
2a5d8ea
51a4e10
2544397
8671f4a
7c0c6fe
9d638d5
fee29e8
a3af7dd
8d0a548
7dcd346
faea117
8ffbef0
8969aa4
d4a9a19
ee94b00
54ce53e
1ecd2d3
7bbeecb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
# Project Movies | ||
|
||
Replace this readme with your own information about your project. | ||
This pair-programming project was to make a react app with multiple pages using routes. | ||
|
||
Start by briefly describing the assignment in a sentence or two. Keep it short and to the point. | ||
✓ Pair-programming | ||
|
||
✓ How to build multi-page applications using React Router. | ||
|
||
✓ How to pass information such as product ids, or blog post titles in the URL and pick this up in React router to load dynamic content. | ||
|
||
✓ Practice using APIs in React - combining `useState` with `useEffect` | ||
|
||
## 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? | ||
We layed out the foundation together planning what was to be done, then branched out making different components. Merging a couple of times then using pair programming getting the components mounted and working toghether. We managed to add a few stretch goals (back button, header and loader). If we had more time we would also add categorys to the header fetching them from the API. | ||
|
||
## 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. | ||
https://master--musical-florentine-5987b8.netlify.app/ | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,41 @@ | ||
import React from 'react'; | ||
import React, { useState, useEffect } from 'react'; | ||
import { BrowserRouter, Route, Routes, Navigate } from 'react-router-dom'; | ||
|
||
import { Loader } from 'components/Loader'; | ||
import { Header } from 'components/Header' | ||
import { MovieList } from 'components/MovieList'; | ||
import { Details } from 'components/Details' | ||
import { NotFound } from 'components/NotFound' | ||
|
||
export const App = () => { | ||
const [movieList, setMovieList] = useState([]); | ||
const [loading, setLoading] = useState(false); | ||
|
||
useEffect(() => { | ||
setLoading(true); | ||
fetch('https://api.themoviedb.org/3/movie/popular?api_key=c78445f7216324dcfc408149681f2fcd&language=en-US&page=1') | ||
.then((data) => data.json()) | ||
.then((configuredData) => { | ||
setMovieList(configuredData.results); | ||
}) | ||
.catch((error) => console.error(error)) | ||
.finally(() => setLoading(false)); | ||
}, []); | ||
if (loading) { | ||
return ( | ||
<Loader /> | ||
) | ||
} | ||
return ( | ||
<div> | ||
Find me in src/app.js! | ||
</div> | ||
<BrowserRouter> | ||
<Header /> | ||
<Routes> | ||
<Route path="/" element={<MovieList movieList={movieList} />} /> | ||
<Route path="/404" element={<NotFound />} /> | ||
<Route path="/*" element={<Navigate to="/404" replace />} /> | ||
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. What does the "replace" thing do? I think i missed that in my code 😯 |
||
<Route path="/details/:movieId" element={<Details details={Details} />} /> | ||
</Routes> | ||
</BrowserRouter> | ||
); | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
.details-page { | ||
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. Nice job using separate .css files for each component. Basically styled components right 😄👍🏼 |
||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.detail-background-picture { | ||
min-height: 100vh; | ||
background-size: cover; | ||
} | ||
|
||
.details { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-end; | ||
} | ||
|
||
.movie-data-cover { | ||
height: 290px; | ||
width: 195px; | ||
border: 5px solid white; | ||
} | ||
|
||
.detail-container { | ||
display: flex; | ||
flex-direction: column; | ||
background-color: #1313139e; | ||
padding: 50px; | ||
} | ||
|
||
.movie-data-section { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.movie-data-title { | ||
color: white; | ||
text-shadow: 1px 1px #4d4d4d; | ||
} | ||
|
||
.movie-data-rating { | ||
display: inline-block; | ||
background-color: white; | ||
padding: 0 5px; | ||
font-size: 20px; | ||
text-shadow: none; | ||
font-weight: 500; | ||
color: black; | ||
} | ||
|
||
.movie-data-overview { | ||
color: white; | ||
max-width: 400px; | ||
} | ||
|
||
@media (min-width: 769px) { | ||
.detail-container { | ||
justify-content: flex-end; | ||
} | ||
|
||
.movie-data-section { | ||
flex-direction: row; | ||
bottom: 20px; | ||
gap: 20px; | ||
align-items: flex-end; | ||
} | ||
|
||
.movie-data-cover { | ||
width: auto; | ||
height: 400px; | ||
} | ||
} |
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 that you kept this in the code!