Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hamzah-kurdi
Copy link

No description provided.

<meta charset="UTF-8" />

<link rel="stylesheet" href="./stylesheet.css">
<title>Hamzah Cracks React</title>
Copy link
Contributor

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 = {
Copy link
Contributor

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"
Copy link
Contributor

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
Copy link
Contributor

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({
Copy link
Contributor

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);
Copy link
Contributor

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 => {
Copy link
Contributor

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" ? (
Copy link
Contributor

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
Copy link
Contributor

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--
Copy link
Contributor

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 {
Copy link
Contributor

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";
Copy link
Contributor

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 {
Copy link
Contributor

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

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.

None yet

2 participants