Skip to content
Snippets Groups Projects

Task edit is now set winner

Merged H9031 requested to merge task-edit-to-set-winner into development
1 file
+ 3
7
Compare changes
  • Side-by-side
  • Inline
@@ -14,12 +14,6 @@ class TaskItem extends React.Component {
this.getFactionlist(this.props.gameId);
}
onEditClick = e => {
this.setState({
edit: !this.state.edit
});
};
getFactionlist(gameId) {
fetch(`${process.env.REACT_APP_API_URL}/game/${gameId}`, {
method: "GET"
@@ -96,7 +90,9 @@ class TaskItem extends React.Component {
)}
</div>
{this.props.task.taskIsActive && this.props.role === "admin" && (
<button onClick={this.onEditClick}>Edit</button>
<button onClick={() => this.setState({ edit: !this.state.edit })}>
{this.state.edit ? "Cancel" : "Set Winner"}
</button>
)}
{this.state.edit && (
<form onSubmit={this.onSaveSubmit}>
Loading