From 953b1a609a8580fecbe0fb42f0e7b65b5b7ebfcc Mon Sep 17 00:00:00 2001 From: Nicola Brunner Date: Fri, 13 Mar 2020 15:21:33 +0100 Subject: [PATCH] navbar is starting to work --- smart-hut/icons.js | 65 ++++++++++++++ smart-hut/src/components/SelectIcons.js | 33 +++++++ smart-hut/src/components/modalform.js | 67 ++++++++++++++ smart-hut/src/views/Navbar.js | 115 ++++++++++++++++++++++++ 4 files changed, 280 insertions(+) create mode 100644 smart-hut/icons.js create mode 100644 smart-hut/src/components/SelectIcons.js create mode 100644 smart-hut/src/components/modalform.js create mode 100644 smart-hut/src/views/Navbar.js diff --git a/smart-hut/icons.js b/smart-hut/icons.js new file mode 100644 index 0000000..3bb4258 --- /dev/null +++ b/smart-hut/icons.js @@ -0,0 +1,65 @@ +1. Home +'home' + +2. Bar +'coffee', 'beer', 'glass martini' + +3. Filmroom +'film', 'video' + +4. Musicroom +'music', 'headphones' + +5. Office +'fax', 'phone', 'laptop' + +6. Bathroom +'bath', 'shower' + +7. Bedroom +'bed', 'child' + +8. Garage +'warehouse', 'car', 'bicycle', 'motorcycle' + +9. Cellar +'archive', 'boxes', 'cubes' + +10. Game Room +'chess', 'gamepad', 'futbol', 'table tennis' + +11. IT Rack +'server' + +12. Livingroom +'tv' + +13. Love Room +'heart' + +14. Hobby Room +'camera', 'trophy', 'wrench' + +15. Gallery +'image' + +16. Library +'book', 'university' + +17. Infirmary +'medkit' + +18. Petroom +'paw' + +19. Garden +'tree' + +20. Kitchen +'utensils' + +21. Toilette +'female', 'male' + +22. Swimmingpool +'life ring outline' diff --git a/smart-hut/src/components/SelectIcons.js b/smart-hut/src/components/SelectIcons.js new file mode 100644 index 0000000..e7d57a1 --- /dev/null +++ b/smart-hut/src/components/SelectIcons.js @@ -0,0 +1,33 @@ +import React, { Component } from 'react'; +import { Button, Header, Image, Modal, Checkbox, Form, Grid, Input, Icon } from 'semantic-ui-react' + +export default class SelectIcons extends Component { + render(){ + const myicons = [['home', 'coffee', 'beer', 'glass martini', 'film', 'video'], + ['music', 'headphones', 'fax', 'phone', 'laptop','bath'], + ['shower', 'bed', 'child', 'warehouse', 'car', 'bicycle'], + ['motorcycle', 'archive', 'boxes', 'cubes', 'chess', 'gamepad'], + ['futbol', 'table tennis', 'server', 'tv', 'heart', 'camera'], + ['trophy', 'wrench', 'image', 'book', 'university', 'medkit'], + ['paw', 'tree', 'utensils', 'male', 'female', 'life ring outline']]; + + var colums = 0; + return ( + + { + myicons.map((e, i) => { + return ( + + {e.map((e) => { + return( + } closeIcon> +
{this.props.type == "new" ? "Add new room" : "Modify room" }
+ +
+

Insert the name of the room:

+ + + +

Insert an image of the room:

+ + + +
+ +
+

Select an icon:

+ +
+ + + +
+ + + + + + + ) + } +} diff --git a/smart-hut/src/views/Navbar.js b/smart-hut/src/views/Navbar.js new file mode 100644 index 0000000..30a2f20 --- /dev/null +++ b/smart-hut/src/views/Navbar.js @@ -0,0 +1,115 @@ +import React, { Component } from 'react'; +import { Menu, Grid, Icon, Button, Header, Image, Modal, Responsive, Segment } from "semantic-ui-react"; +import {editButtonStyle} from "../components/dashboard/devices/styleComponents"; +import ModalWindow from "../components/modalform"; + +class Navbar extends Component { + constructor(props) { + super(props); + this.state = { + activeItem: 'Home', + edited: "" + } + } + + showForm = (event) => { + console.log(event.target.name); + if (event === "new"){ + console.log("funziona"); + return () + } + } + + handleClick = (e, { i }) => { + this.setState({ activeItem: e.name, + edited: i + }); + this.props.handleItemClick(e) + } + + render(){ + const { activeItem } = this.state + return ( +
+ + + + + + + + + + + + + + + + Home + + + + + + + {this.props.rooms ? + this.props.rooms.map((e, i) => { + return ( + + + + + + + + {e.name} + + + + + + + + + + ) + }) : null + } + + + + + + + + + + + + + + + + + //dropdown menu + + +
+ ); + } +} + +export default Navbar;