-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame_buttons.js
32 lines (29 loc) · 1013 Bytes
/
game_buttons.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
'use strict';
class Buttons extends React.Component {
constructor(props) {
super(props);
this.handleClick = this.handleClick.bind(this);
}
handleClick(e) {
const newVerb = (e.target.value)
this.props.onClick(newVerb);
}
render() {
return(
<div className="buttons">
<button type="button" className="btn btn-primary verb-button" value='push' onClick={this.handleClick}>
Push
</button>
<button type="button" className="btn btn-primary verb-button"value='look' onClick={this.handleClick}>
Look At
</button>
<button type="button" className="btn btn-primary verb-button"value='pickUp' onClick={this.handleClick}>
Pick Up
</button>
<button type="button" className="btn btn-primary verb-button"value='use' onClick={this.handleClick}>
Use
</button>
</div>
)
}
}