Created
February 17, 2018 13:47
-
-
Save fdjones/9fbfa5b24906a8f69b32e3bff870676a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import Task from './Task'; | |
// type tTask = { | |
// title: string, | |
// details: string, | |
// ID: number | |
// } | |
// type tProps = { | |
// tasks: Array<tTask>, | |
// }; | |
class TaskList extends React.Component { | |
constructor(props) { | |
super(props); | |
this.updateStatus = this.updateStatus.bind(this); | |
this.state = { | |
isInProgress: true, | |
}; | |
} | |
updateStatus() { | |
this.setState({ isInProgress: !this.state.isInProgress }); | |
} | |
render() { | |
return ( | |
<div className="tasks-wrapper"> | |
{this.props.tasks.map(task => ( | |
<Task | |
taskData={task} | |
onClick={this.updateStatus} | |
/> | |
))} | |
</div> | |
); | |
} | |
} | |
export default TaskList; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment