-
-
Notifications
You must be signed in to change notification settings - Fork 761
RAYMOND react hotel #5
Conversation
…und during search exercise CodeYourFuture#5
|
got the days stayed row fixed |
| @@ -1,18 +1,62 @@ | |||
| import React, { Component } from "react"; | |||
| import Search from "../components/Search.js"; | |||
| import ResultsTable from '../components/ResultsTable' | |||
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.
Do you use Windows? though this might work on your machine this file is named resultsTable.js and you import it with capital here. Best to always use capital in react projects
| isClicked: true, | ||
| }); | ||
| } | ||
| sortIt = (thing) => { |
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.
what is thing?! need to name things better
| sortIt = (thing) => { | ||
| console.log('thing:', thing) | ||
| const bookings = this.state.bookings | ||
| const sortedBookings = this.state.bookings.sort() |
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.
You need to filter by the particular header that is clicked, there is no single way to sort a data table
| }) | ||
| } | ||
| } | ||
| // selectedRows = (){ |
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.
Not good to push commented out code, delete them before pushing
| }; | ||
| } | ||
| search = () => { | ||
| console.info("to do!"); |
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.
Why is this still console info?
| } | ||
| } | ||
|
|
||
| onClicked = () => { |
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.
onClick is not a good name for a function, I assume this is the search?
| @@ -0,0 +1,10 @@ | |||
| import React from 'react'; | |||
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.
This is not really a component, just a function. So you don't really need to import React here
worked up to number 5 so far