2020-03-19 10:52:13 +00:00
|
|
|
import React from "react";
|
2020-03-23 20:24:17 +00:00
|
|
|
import { Dropdown, Icon, Grid, Divider } from "semantic-ui-react";
|
|
|
|
import { Segment, Image } from "semantic-ui-react";
|
2020-03-24 09:10:49 +00:00
|
|
|
import {
|
|
|
|
BrowserView,
|
|
|
|
MobileView,
|
|
|
|
isBrowser,
|
2020-03-24 15:03:08 +00:00
|
|
|
isMobile,
|
2020-03-24 09:10:49 +00:00
|
|
|
} from "react-device-detect";
|
2020-03-13 13:43:31 +00:00
|
|
|
|
2020-03-21 15:06:18 +00:00
|
|
|
const AvatarImage = () => (
|
2020-03-24 15:03:08 +00:00
|
|
|
<Image src="avatar3.png" style={{ width: "25px", height: "auto" }} centered />
|
2020-03-23 20:24:17 +00:00
|
|
|
);
|
2020-03-13 13:43:31 +00:00
|
|
|
|
2020-03-23 20:24:17 +00:00
|
|
|
const IconHomeImage = () => (
|
|
|
|
<Image
|
|
|
|
src="smart-home.png"
|
|
|
|
style={{ width: "50px", height: "auto" }}
|
|
|
|
centered
|
|
|
|
as="a"
|
|
|
|
href="/"
|
|
|
|
/>
|
|
|
|
);
|
2020-03-13 13:43:31 +00:00
|
|
|
|
2020-03-24 09:10:49 +00:00
|
|
|
const IconHomeImageMobile = () => (
|
|
|
|
<Image
|
|
|
|
src="smart-home.png"
|
|
|
|
style={{ width: "10px", height: "auto" }}
|
|
|
|
centered
|
|
|
|
as="a"
|
|
|
|
href="/"
|
|
|
|
/>
|
|
|
|
);
|
2020-03-13 13:43:31 +00:00
|
|
|
|
2020-03-24 15:03:08 +00:00
|
|
|
const TitleImage = () => <Image src="title7.png" size="medium" centered />;
|
2020-03-24 09:10:49 +00:00
|
|
|
|
2020-03-24 15:03:08 +00:00
|
|
|
const BrowserStructure = (props) => (
|
2020-03-23 20:24:17 +00:00
|
|
|
<Grid columns="equal" divided inverted padded>
|
|
|
|
<Grid.Row color="black" textAlign="center">
|
|
|
|
<Grid.Column width={3} height={0.5}>
|
|
|
|
<Segment color="black" inverted>
|
|
|
|
<IconHomeImage />
|
|
|
|
</Segment>
|
|
|
|
</Grid.Column>
|
|
|
|
<Grid.Column>
|
|
|
|
<Segment color="black" inverted>
|
2020-03-21 15:06:18 +00:00
|
|
|
<TitleImage />
|
2020-03-23 20:24:17 +00:00
|
|
|
</Segment>
|
|
|
|
</Grid.Column>
|
|
|
|
<Grid.Column width={2} heigth={1}>
|
|
|
|
<AvatarImage />
|
2020-03-13 13:43:31 +00:00
|
|
|
<Divider />
|
2020-03-23 20:24:17 +00:00
|
|
|
<Dropdown item icon="setting" size="huge">
|
|
|
|
<Dropdown.Menu>
|
|
|
|
<Dropdown.Item>
|
|
|
|
<Icon name="dropdown" />
|
|
|
|
<span className="text">Settings</span>
|
|
|
|
<Dropdown.Menu>
|
|
|
|
<Dropdown.Item>Document</Dropdown.Item>
|
|
|
|
<Dropdown.Item>Image</Dropdown.Item>
|
|
|
|
</Dropdown.Menu>
|
|
|
|
</Dropdown.Item>
|
|
|
|
<Dropdown.Item>See profile...</Dropdown.Item>
|
|
|
|
<Dropdown.Divider />
|
|
|
|
<Dropdown.Item onClick={props.logout}>Logout</Dropdown.Item>
|
|
|
|
</Dropdown.Menu>
|
|
|
|
</Dropdown>
|
|
|
|
</Grid.Column>
|
|
|
|
</Grid.Row>
|
2020-03-24 15:03:08 +00:00
|
|
|
</Grid>
|
2020-03-23 20:24:17 +00:00
|
|
|
);
|
2020-03-13 13:43:31 +00:00
|
|
|
|
2020-03-24 15:03:08 +00:00
|
|
|
const MobileStructure = (props) => (
|
2020-03-24 09:10:49 +00:00
|
|
|
<Grid columns="equal" divided inverted padded>
|
|
|
|
<Grid.Row color="black" textAlign="center">
|
|
|
|
<Segment color="black" inverted>
|
|
|
|
<TitleImage />
|
|
|
|
</Segment>
|
|
|
|
</Grid.Row>
|
|
|
|
<Grid.Row color="black" textAlign="center">
|
|
|
|
<Grid.Column>
|
|
|
|
<IconHomeImage />
|
|
|
|
</Grid.Column>
|
2020-03-24 15:03:08 +00:00
|
|
|
<Grid.Column>
|
|
|
|
<AvatarImage />
|
|
|
|
<Divider />
|
|
|
|
<Dropdown item icon="setting" size="huge">
|
|
|
|
<Dropdown.Menu>
|
|
|
|
<Dropdown.Item>
|
|
|
|
<Icon name="dropdown" />
|
|
|
|
<span className="text">Settings</span>
|
|
|
|
<Dropdown.Menu>
|
|
|
|
<Dropdown.Item>Document</Dropdown.Item>
|
|
|
|
<Dropdown.Item>Image</Dropdown.Item>
|
|
|
|
</Dropdown.Menu>
|
|
|
|
</Dropdown.Item>
|
|
|
|
<Dropdown.Item>See profile...</Dropdown.Item>
|
|
|
|
<Dropdown.Divider />
|
|
|
|
<Dropdown.Item onClick={props.logout}>Logout</Dropdown.Item>
|
|
|
|
</Dropdown.Menu>
|
|
|
|
</Dropdown>
|
2020-03-24 09:10:49 +00:00
|
|
|
</Grid.Column>
|
2020-03-24 15:03:08 +00:00
|
|
|
</Grid.Row>
|
|
|
|
</Grid>
|
2020-03-24 09:10:49 +00:00
|
|
|
);
|
2020-03-23 20:24:17 +00:00
|
|
|
|
2020-03-24 09:10:49 +00:00
|
|
|
export default class MyHeader extends React.Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<BrowserView>
|
|
|
|
<BrowserStructure logout={this.props.logout} />
|
|
|
|
</BrowserView>
|
|
|
|
<MobileView>
|
|
|
|
<MobileStructure />
|
|
|
|
</MobileView>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|