Skip to content

basic functionality working, stretch goals still to come. Styling is lacking in areas.#3

Open
hamzah-kurdi wants to merge 2 commits intoconstructorlabs:masterfrom
hamzah-kurdi:master
Open

basic functionality working, stretch goals still to come. Styling is lacking in areas.#3
hamzah-kurdi wants to merge 2 commits intoconstructorlabs:masterfrom
hamzah-kurdi:master

Conversation

@hamzah-kurdi
Copy link
Copy Markdown

No description provided.

Comment thread index.html
<meta charset="UTF-8" />

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like it

Comment thread src/Components/App.js
import Results from "./Results";
import MoreInfo from "./MoreInfo";

const config = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

Comment thread src/Components/App.js
imdbLink: "https://www.imdb.com/title/",
imdbID: "",
details: {},
errorPic: "./assets/woops.jpg"
Copy link
Copy Markdown
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

Comment thread src/Components/App.js
recieveFilmInfo(results) {
this.setState({
films: results.Search,
imdbID: results.Search.imdbID
Copy link
Copy Markdown
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

Comment thread src/Components/App.js
}

closeDetails(showDetailedInfo) {
this.setState({
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread src/Components/Results.js
return (
<div>
<ul>
{films.map(film => {
Copy link
Copy Markdown
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

Comment thread src/Components/Results.js

export default Results;

// {film.Poster.value != "N/A" ? (
Copy link
Copy Markdown
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

Comment thread src/Components/Search.js
addPage(event) {
event.preventDefault();
this.setState({
page: page + 1
Copy link
Copy Markdown
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

Comment thread src/Components/Search.js
event.preventDefault();
if (this.state.page > 0) {
this.setState({
page: page--
Copy link
Copy Markdown
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

Comment thread src/Components/Search.js
page: page--
});
this.paginationFetch();
} else {
Copy link
Copy Markdown
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

Comment thread src/index.js
import App from './App';
import React from "react";
import ReactDOM from "react-dom";
import App from "./Components/App";
Copy link
Copy Markdown
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

Comment thread stylesheet.css
width: 300px;
}

#More_Info {
Copy link
Copy Markdown
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