From 133daa5076c36d8ba0fba55212163638d96c1fc5 Mon Sep 17 00:00:00 2001 From: Joni Laukka <joni.laukka.overflow@gmail.com> Date: Thu, 18 Jul 2019 10:40:55 +0300 Subject: [PATCH] Notification form is not visible if game state is "ENDED" or "CREATED" --- src/App.js | 2 -- src/components/NotificationView.js | 54 ++++++++++++++++-------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/App.js b/src/App.js index b1752f7..c0fb6be 100644 --- a/src/App.js +++ b/src/App.js @@ -1,8 +1,6 @@ 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, diff --git a/src/components/NotificationView.js b/src/components/NotificationView.js index 2fb0410..59731f9 100644 --- a/src/components/NotificationView.js +++ b/src/components/NotificationView.js @@ -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> -- GitLab