Skip to content
Snippets Groups Projects
Commit 133daa50 authored by Joni Laukka's avatar Joni Laukka
Browse files

Notification form is not visible if game state is "ENDED" or "CREATED"

parent a5aa14d1
No related branches found
No related tags found
3 merge requests!46Development to testing,!41Notifications + small updates,!39Notification view
This commit is part of merge request !41. Comments created here will be created in the context of that merge request.
import React, { Component } from "react";
import "../node_modules/leaflet-draw/dist/leaflet.draw.css";
import "./App.css";
import ClientSocket from "./components/Socket";
import {
BrowserRouter as Router,
Route,
......
......@@ -58,32 +58,34 @@ export default class NotificationView extends React.Component {
Close
</button>
<div>
{this.props.role === "admin" && this.props.gameState !== "ENDED" && (
<form onSubmit={this.handleSend}>
<select
id="notificationViewTypeSelect"
value={this.state.notificationTypeInput}
onChange={e =>
this.setState({ notificationTypeInput: e.target.value })
}
>
<option value="note">Note</option>
<option value="alert">Alert</option>
</select>
<input
id="notificationViewMessageInput"
type="text"
value={this.state.notificationInput}
onChange={e =>
this.setState({ notificationInput: e.target.value })
}
placeholder="Notification message..."
/>
<button id="notificationSubmitButton" type="submit">
Send Notification
</button>
</form>
)}
{this.props.role === "admin" &&
this.props.gameState !== "ENDED" &&
this.props.gameState !== "CREATED" && (
<form onSubmit={this.handleSend}>
<select
id="notificationViewTypeSelect"
value={this.state.notificationTypeInput}
onChange={e =>
this.setState({ notificationTypeInput: e.target.value })
}
>
<option value="note">Note</option>
<option value="alert">Alert</option>
</select>
<input
id="notificationViewMessageInput"
type="text"
value={this.state.notificationInput}
onChange={e =>
this.setState({ notificationInput: e.target.value })
}
placeholder="Notification message..."
/>
<button id="notificationSubmitButton" type="submit">
Send Notification
</button>
</form>
)}
</div>
{notifications}
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment