From 74d5be79672dba5450dbeff510b05788bf298c48 Mon Sep 17 00:00:00 2001 From: omenem Date: Thu, 7 May 2020 09:29:22 +0200 Subject: [PATCH] fix --- smart-hut/src/components/RoomModal.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/smart-hut/src/components/RoomModal.js b/smart-hut/src/components/RoomModal.js index 653c763..b6d55d2 100644 --- a/smart-hut/src/components/RoomModal.js +++ b/smart-hut/src/components/RoomModal.js @@ -8,6 +8,7 @@ import { Icon, Responsive, Image, + Confirm, } from "semantic-ui-react"; import SelectIcons from "./SelectIcons"; import { connect } from "react-redux"; @@ -34,6 +35,7 @@ class RoomModal extends Component { name: this.type === "new" ? "New Room" : this.props.room.name, img: this.type === "new" ? null : this.props.room.image, openModal: false, + sure: false, }; } @@ -91,6 +93,14 @@ class RoomModal extends Component { .catch((err) => console.error("error in deleting room", err)); }; + setSureTrue = () => { + this.setState({sure: true}) + } + + setSureFalse= () => { + this.setState({sure: false}) + } + changeSomething = (event) => { let nam = event.target.name; let val = event.target.value; @@ -220,16 +230,22 @@ class RoomModal extends Component { {this.type === "modify" ? ( +
+ Delete Room + +
+ ) : null}