diff --git a/smart-hut/src/components/modalform.js b/smart-hut/src/components/modalform.js
index 0c704f7..87835a3 100644
--- a/smart-hut/src/components/modalform.js
+++ b/smart-hut/src/components/modalform.js
@@ -104,29 +104,48 @@ export default class ModalWindow extends Component {
};
return (
-
- {this.props.type === "new" ? (
-
- ) : (
-
- )}
-
-
- {this.props.type === "new" ? (
-
- ) : (
-
- )}
-
+ {!this.props.nicolaStop ? (
+
+
+ {this.props.type === "new" ? (
+
+ ) : (
+
+ )}
+
+
+ {this.props.type === "new" ? (
+
+ ) : (
+
+ )}
+
+
+ ) : null}
diff --git a/smart-hut/src/views/Navbar.js b/smart-hut/src/views/Navbar.js
index 7a2ece7..27f1196 100644
--- a/smart-hut/src/views/Navbar.js
+++ b/smart-hut/src/views/Navbar.js
@@ -1,5 +1,12 @@
import React, { Component } from "react";
-import { Menu, Grid, Icon, Responsive, Dropdown } from "semantic-ui-react";
+import {
+ Menu,
+ Button,
+ Grid,
+ Icon,
+ Responsive,
+ Dropdown,
+} from "semantic-ui-react";
import { editButtonStyle } from "../components/dashboard/devices/styleComponents";
import ModalWindow from "../components/modalform";
@@ -13,6 +20,11 @@ class Navbar extends Component {
editMode: false,
room: "",
};
+
+ this.roomRefs = {};
+ this.props.rooms.forEach((e) => {
+ this.roomRefs[e.id] = React.createRef();
+ });
}
componentDidMount() {
@@ -137,6 +149,8 @@ class Navbar extends Component {
{this.props.rooms
? this.props.rooms.map((e, i) => {
+ if (!this.roomRefs[e.id])
+ this.roomRefs[e.id] = React.createRef();
return (
{e.name}
+
);
})
@@ -167,15 +189,17 @@ class Navbar extends Component {
{this.state.activeItem !== -1 ? (
- {
- console.log("MALUSA", this.activeRoom);
- return this.activeRoom;
- }}
- updateRoom={this.props.updateRoom}
- deleteRoom={this.props.deleteRoom}
- />
+
) : null}