Created
February 13, 2020 22:45
-
-
Save adhawkins/16b8e5289d06aba0223633ba184cd8a3 to your computer and use it in GitHub Desktop.
This file contains 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 Row from 'react-bootstrap/Row'; | |
import Col from 'react-bootstrap/Col'; | |
import Button from 'react-bootstrap/Button'; | |
class EntryControls extends React.Component { | |
constructor(props) { | |
super(props); | |
this.handleAddTextEntryClick = this.handleAddTextEntryClick.bind(this); | |
this.handleStartClick = this.handleStartClick.bind(this); | |
this.handleIntroClick = this.handleIntroClick.bind(this); | |
this.handleMissionClick = this.handleMissionClick.bind(this); | |
this.handleCutsceneClick = this.handleCutsceneClick.bind(this); | |
this.handleTrashClick = this.handleTrashClick.bind(this); | |
this.handleStopClick = this.handleStopClick.bind(this); | |
} | |
handleAddTextEntryClick(e) { | |
if (this.props.addTextEntryClicked) { | |
this.props.addTextEntryClicked(e); | |
} | |
} | |
handleStartClick(e) { | |
if (this.props.startClicked) { | |
this.props.startClicked(e); | |
} | |
} | |
handleIntroClick(e) { | |
if (this.props.introClicked) { | |
this.props.introClicked(e); | |
} | |
} | |
handleMissionClick(e) { | |
if (this.props.missionClicked) { | |
this.props.missionClicked(e); | |
} | |
} | |
handleCutsceneClick(e) { | |
if (this.props.cutsceneClicked) { | |
this.props.cutsceneClicked(e); | |
} | |
} | |
handleTrashClick(e) { | |
if (this.props.trashClicked) { | |
this.props.trashClicked(e); | |
} | |
} | |
handleStopClick(e) { | |
if (this.props.stopClicked) { | |
this.props.stopClicked(e); | |
} | |
} | |
render() { | |
return ( | |
<React.Fragment> | |
<Row className="p-1"> | |
<Col> | |
Entry: <input data-bind="value: entryName" /> | |
</Col> | |
<Col> | |
<Button onClick={this.handleAddTextEntryClick}>Add Text Entry</Button> | |
</Col> | |
</Row> | |
<Row className="p-1"> | |
<Col> | |
<Button onClick={this.handleStartClick}>Start</Button> | |
</Col> | |
<Col> | |
<Button onClick={this.handleIntroClick}>Intro</Button> | |
</Col> | |
<Col> | |
<Button onClick={this.handleMissionClick}>Mission</Button> | |
</Col> | |
<Col> | |
<Button onClick={this.handleCutsceneClick}>Cutscene</Button> | |
</Col> | |
<Col> | |
<Button onClick={this.handleTrashClick}>Trash</Button> | |
</Col> | |
<Col> | |
<Button onClick={this.handleStopClick}>Stop</Button> | |
</Col> | |
</Row> | |
</React.Fragment> | |
); | |
} | |
} | |
export default EntryControls; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment