diff --git a/smart-hut/src/components/SceneModal.js b/smart-hut/src/components/SceneModal.js index cffa062..2219a80 100644 --- a/smart-hut/src/components/SceneModal.js +++ b/smart-hut/src/components/SceneModal.js @@ -8,6 +8,7 @@ import { Form, Input, } from "semantic-ui-react"; +import SelectIcons from "./SelectIcons"; import { connect } from "react-redux"; import { RemoteService } from "../remote"; import { appActions } from "../storeActions"; @@ -20,12 +21,14 @@ class SceneModal extends Component { this.addSceneModal = this.addSceneModal.bind(this); this.modifySceneModal = this.modifySceneModal.bind(this); this.deleteScene = this.deleteScene.bind(this); + this.updateIcon = this.updateIcon.bind(this); } get initialState() { return { name: this.type === "new" ? "New Scene" : this.props.scene.name, openModal: false, + selectedIcon: "home", }; } @@ -40,6 +43,7 @@ class SceneModal extends Component { addSceneModal = (e) => { let data = { name: this.state.name, + icon: this.state.selectedIcon, }; this.props @@ -54,6 +58,7 @@ class SceneModal extends Component { modifySceneModal = (e) => { let data = { name: this.state.name, + icon: this.state.selectedIcon, }; this.props @@ -86,7 +91,16 @@ class SceneModal extends Component { this.setState({ openModal: true }); }; + updateIcon(e) { + this.setState({ selectedIcon: e }); + } + render() { + const spaceDiv = { + background: "#f4f4f4", + padding: "10px 10px", + margin: "10px 0px", + }; return (
Select an icon:
+