diff --git a/src/App.js b/src/App.js index b1752f70d4e09e5afc57d112005bc247f8d70d8e..c0fb6be1e2302e9f6f186b126553e0afe4508a78 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 2fb041042b104da60747bb1a6fe7c0357b4bad5b..59731f992152f9b20da17059381da31ea7010927 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>