Skip to content

Completed homework.#11

Open
dgallinger wants to merge 1 commit into
frontend-application-development-uw20:masterfrom
dgallinger:master
Open

Completed homework.#11
dgallinger wants to merge 1 commit into
frontend-application-development-uw20:masterfrom
dgallinger:master

Conversation

@dgallinger
Copy link
Copy Markdown

Week 3 HW Submission

Please fill out the information below in order to complete your assignment. Feel free to update this comment later if necessary.

  • Comfort rating on this assignment (1-5): 1|2|3|4|5
    Comfort Rating 3
  • Completion rating on this assignment: complete|incomplete
    Complete

Comment thread ecommerce-ui/src/App.js

function App() {
return (
<>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I don't think you need the fragments if there is one parent component.


render () {
return (
this.props.propertyData.map((property, i) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice!

<div className="image">
<img src={property.image} alt="" height='250' width='400'/>
</div>
<div className="location">{property.location.city},{' '}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
<div className="location">{property.location.city},{' '}
<div className="location">{[property.location.city, property.location.country].join(', ')

{property.location.country}
</div>
<div className="description">{property.houseType}</div>
<div className="rating">{property.rating.stars}\5{' '}Stars
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would just use string interpolation instead of dropping in these spaces.

Suggested change
<div className="rating">{property.rating.stars}\5{' '}Stars
<div className="rating">`${property.rating.stars}\5 Stars`

totalCost: this.state.totalCost + parseInt(cost)
})
} else {
alert('Property already in cart.');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice!

super(props);
this.state = {
infoArray: [],
costArray: [],
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do these need to be separate arrays? Can you maintain an array of objects and then use Array.map?

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