Skip to content

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.

2 participants