From 580511ce6ecbb494eae0384117c75ec40357e133 Mon Sep 17 00:00:00 2001 From: Nicola Brunner Date: Tue, 24 Mar 2020 16:03:08 +0100 Subject: [PATCH] is prettier --- smart-hut/src/components/HeaderController.js | 68 +++---- smart-hut/src/components/SelectIcons.js | 7 +- smart-hut/src/components/modalform.js | 179 +++++++++++-------- 3 files changed, 130 insertions(+), 124 deletions(-) diff --git a/smart-hut/src/components/HeaderController.js b/smart-hut/src/components/HeaderController.js index 4391de6..acc4259 100644 --- a/smart-hut/src/components/HeaderController.js +++ b/smart-hut/src/components/HeaderController.js @@ -5,14 +5,11 @@ import { BrowserView, MobileView, isBrowser, - isMobile + isMobile, } from "react-device-detect"; const AvatarImage = () => ( - + ); const IconHomeImage = () => ( @@ -35,15 +32,9 @@ const IconHomeImageMobile = () => ( /> ); -const TitleImage = () => ( - -); +const TitleImage = () => ; -const BrowserStructure = (props) => ( +const BrowserStructure = (props) => ( @@ -76,10 +67,10 @@ const BrowserStructure = (props) => ( - + ); -const MobileStructure = (props) => ( +const MobileStructure = (props) => ( @@ -90,36 +81,29 @@ const MobileStructure = (props) => ( - - - - - - - - Settings - - Document - Image - - - See profile... - - Logout - - + + + + + + + + Settings + + Document + Image + + + See profile... + + Logout + + - - + + ); - - - - - - - export default class MyHeader extends React.Component { render() { return ( diff --git a/smart-hut/src/components/SelectIcons.js b/smart-hut/src/components/SelectIcons.js index 44f3d3d..bbefcc1 100644 --- a/smart-hut/src/components/SelectIcons.js +++ b/smart-hut/src/components/SelectIcons.js @@ -1,5 +1,5 @@ -import React, { Component } from 'react'; -import { Button, Grid, Responsive } from 'semantic-ui-react' +import React, { Component } from "react"; +import { Button, Grid, Responsive } from "semantic-ui-react"; export default class SelectIcons extends Component { constructor(props) { @@ -31,8 +31,7 @@ export default class SelectIcons extends Component { return ( - { - myicons.map((e, i) => { + {myicons.map((e, i) => { return ( {e.map((e, i) => { diff --git a/smart-hut/src/components/modalform.js b/smart-hut/src/components/modalform.js index 12740a0..3669173 100644 --- a/smart-hut/src/components/modalform.js +++ b/smart-hut/src/components/modalform.js @@ -7,17 +7,17 @@ import { Input, Icon, Responsive, - Image + Image, } from "semantic-ui-react"; import SelectIcons from "./SelectIcons"; -const NO_IMAGE="https://react.semantic-ui.com/images/wireframe/image.png"; +const NO_IMAGE = "https://react.semantic-ui.com/images/wireframe/image.png"; export default class ModalWindow extends Component { constructor(props) { super(props); -console.table(this.props); + console.table(this.props); this.state = { id: "", @@ -84,14 +84,13 @@ console.table(this.props); let reader = new FileReader(); reader.readAsDataURL(file.target.files[0]); reader.onload = () => { - this.state.img = reader.result; - this.setState(this.state); + this.state.img = reader.result; + this.setState(this.state); }; reader.onerror = console.error; } - render(){ - + render() { const spaceDiv = { background: "#f4f4f4", padding: "10px 10px", @@ -115,81 +114,105 @@ console.table(this.props); ) - : - - } - - - { - this.props.type === "new" ? - - : - - } - + + ) : ( + + )} + + + {this.props.type === "new" ? ( + + ) : ( + + )} + - -
{this.props.type === "new" ? "Add new room" : "Modify room" }
- -
-

Insert the name of the room:

- - - -

Insert an image of the room:

- + +
+ {this.props.type === "new" ? "Add new room" : "Modify room"} +
+ + +

Insert the name of the room:

+ + + +

Insert an image of the room:

+ + this.fileInputRef.current.click()} + /> - this.fileInputRef.current.click()}/> + + + - +
+

Select an icon:

+ +
-
- + {this.props.type === "modify" ? ( + + ) : null} +
+ + -
-

Select an icon:

- -
- - {this.props.type === "modify" ? - : null } - - - - - - - - - -
- - ) + + + + + ); } }