-
Notifications
You must be signed in to change notification settings - Fork 35
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
basic functionality working, stretch goals still to come. Styling is lacking in areas. #3
base: master
Are you sure you want to change the base?
Conversation
<meta charset="UTF-8" /> | ||
|
||
<link rel="stylesheet" href="./stylesheet.css"> | ||
<title>Hamzah Cracks React</title> |
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.
like it
import Results from "./Results"; | ||
import MoreInfo from "./MoreInfo"; | ||
|
||
const config = { |
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
imdbLink: "https://www.imdb.com/title/", | ||
imdbID: "", | ||
details: {}, | ||
errorPic: "./assets/woops.jpg" |
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.
if error pic does not change, it could be better off being specified in a config or variable. Reserve state for things that will be changed by your app. Same applies to imdbLink
recieveFilmInfo(results) { | ||
this.setState({ | ||
films: results.Search, | ||
imdbID: results.Search.imdbID |
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.
I am not sure the Search property has an imdbID field as it's an array
} | ||
|
||
closeDetails(showDetailedInfo) { | ||
this.setState({ |
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
import React from "react"; | ||
|
||
function MoreInfo({ details, closeDetails }) { | ||
console.log(details); |
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.
Avoid committing console.logs
return ( | ||
<div> | ||
<ul> | ||
{films.map(film => { |
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.
good use of naming conventions
|
||
export default Results; | ||
|
||
// {film.Poster.value != "N/A" ? ( |
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.
Avoid committing commented out code
addPage(event) { | ||
event.preventDefault(); | ||
this.setState({ | ||
page: page + 1 |
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.
page is likely to be undefined here. You probably meant this.state.page
event.preventDefault(); | ||
if (this.state.page > 0) { | ||
this.setState({ | ||
page: page-- |
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.
page is likely to be undefined here. You probably meant this.state.page
page: page-- | ||
}); | ||
this.paginationFetch(); | ||
} else { |
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.
If you are on page 0, the else can be omitted as we probably don't want to do anything in this case
import App from './App'; | ||
import React from "react"; | ||
import ReactDOM from "react-dom"; | ||
import App from "./Components/App"; |
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.
use lower case for folder names. it will give you fewer things to worry about
width: 300px; | ||
} | ||
|
||
#More_Info { |
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.
use lower case for css id and class names
No description provided.