Skip to content

Commit

Permalink
wave1
Browse files Browse the repository at this point in the history
  • Loading branch information
KatherineJF committed Nov 30, 2018
1 parent 5eff58e commit c59c7f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,24 @@ class App extends Component {
for (let i = 0; i < 9; i++){
bins.push({ isTrashVisible: (Math.round(Math.random()) ? true : false )});
}

console.log(bins);
return bins;
}

onTrashClicked = () => {
// Fill this in!
//this.setState({Points: this.state.points });
<button
score={ this.state.points }
onClick={ this.markPresentClickHandler } >
Increase Points
</button>

}

render() {
const bins = this.state.bins.map((bin, index) => {
return (
<Trash key={`trash-${index}`} />
<Trash key={`trash-${index}`} isTrashVisible={bin.isTrashVisible} />
);
});

Expand Down
4 changes: 3 additions & 1 deletion src/components/Trash.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import TrashIcon from '../trash.svg';

class Trash extends Component {
render() {
// if true show image if false it won't show
return (
<div className="bin">
<img src={ TrashIcon } alt="Trash" className="trash"></img>
{this.props.isTrashVisible && <img src={ TrashIcon } alt="Trash" className="trash"></img>}
</div>

);
}
}
Expand Down

0 comments on commit c59c7f0

Please sign in to comment.