From bf8e822fc7af0795b19c15e3dfd9c8b95bc0afd4 Mon Sep 17 00:00:00 2001 From: Nicola Brunner Date: Wed, 6 May 2020 13:43:07 +0200 Subject: [PATCH] modified signup, uniformed message if no scene, device or hosts --- .../src/components/dashboard/DevicePanel.js | 37 +++++++++++++------ .../src/components/dashboard/HostsPanel.js | 17 ++++++--- .../src/components/dashboard/ScenesPanel.js | 5 ++- smart-hut/src/views/Signup.js | 2 +- 4 files changed, 42 insertions(+), 19 deletions(-) diff --git a/smart-hut/src/components/dashboard/DevicePanel.js b/smart-hut/src/components/dashboard/DevicePanel.js index 73196df..23db867 100644 --- a/smart-hut/src/components/dashboard/DevicePanel.js +++ b/smart-hut/src/components/dashboard/DevicePanel.js @@ -1,7 +1,7 @@ // vim: set ts=2 sw=2 et tw=80: import React, { Component } from "react"; -import { Segment, Card } from "semantic-ui-react"; +import { Segment, Card, Header, Icon } from "semantic-ui-react"; import Device from "./devices/Device"; import NewDevice from "./devices/NewDevice"; import { connect } from "react-redux"; @@ -25,16 +25,31 @@ class DevicePanel extends Component { render() { return ( - {this.props.devices.map((e, i) => { - return ; - })} - {!this.props.isActiveRoomHome ? ( - - - - - - ) : null} + {this.props.devices.length !== 0 ? ( + + {this.props.devices.map((e, i) => { + return ; + })} + {!this.props.isActiveRoomHome ? ( + + + + + + ) : null} + + ) : ( + +
+ + Please create a room on the left, and then add devices to the + same. +
+
+ )}
); } diff --git a/smart-hut/src/components/dashboard/HostsPanel.js b/smart-hut/src/components/dashboard/HostsPanel.js index 2fb2da6..5a6d380 100644 --- a/smart-hut/src/components/dashboard/HostsPanel.js +++ b/smart-hut/src/components/dashboard/HostsPanel.js @@ -19,12 +19,17 @@ class HostsPanel extends Component { render() { if (this.props.isActiveDefaultHost) { return ( - -
- - Please select a host to visit on the left. -
-
+ + +
+ + Please select a host to visit on the left. +
+
+
); } diff --git a/smart-hut/src/components/dashboard/ScenesPanel.js b/smart-hut/src/components/dashboard/ScenesPanel.js index a9b2210..2be4cd1 100644 --- a/smart-hut/src/components/dashboard/ScenesPanel.js +++ b/smart-hut/src/components/dashboard/ScenesPanel.js @@ -44,7 +44,10 @@ class ScenesPanel extends Component { ) : (
- + Please select a scene on the left or add a new one.
diff --git a/smart-hut/src/views/Signup.js b/smart-hut/src/views/Signup.js index 5ad8af5..c0de088 100644 --- a/smart-hut/src/views/Signup.js +++ b/smart-hut/src/views/Signup.js @@ -116,7 +116,7 @@ export default class Signup extends Component {