Skip to content

Instantly share code, notes, and snippets.

@nhanco
Last active February 28, 2018 12:11
Show Gist options
  • Save nhanco/9b998d949e21a4bbc94c5876832a3d4d to your computer and use it in GitHub Desktop.
Save nhanco/9b998d949e21a4bbc94c5876832a3d4d to your computer and use it in GitHub Desktop.
import React from "react"
import { translate } from "react-i18next"
import { Button, Container, Divider, Grid, Icon, Menu, Segment, Input, Responsive } from "semantic-ui-react"
import Link from "next/link"
import MetaTags from "./HeadTags"
const menuItem = [ "workflow", "plugins", "events", "training", "contact" ]
export default class topMenu extends React.Component {
constructor(props) {
super(props)
this.state = {
active: this.props.topMenu,
}
}
render() {
return (
<div >
<MetaTags
title=""
description="abc"
urlPath={this.urlPath}
/>
<Menu fixed="top" size="small" inverted color="blue" id="topMenu" role="navigation" >
<Container>
<a href="/">
<Link href="/">
<img src="static/images/favicon.png" alt="VBO solutions" className="logo" role="brand" />
</Link>
</a>
<Responsive
{...Responsive.onlyMobile}
as="div"
className="item"
>
<Button icon color="blue" basic inverted>
<Icon name="sidebar" />
</Button>
</Responsive>
<Responsive
{...Responsive.onlyComputer}
className="item"
>
{
menuItem.map((item, i) => {
if (item === this.state.active) {
return <Menu.Item as="a" href={item} key={i} name={item} active />
}
return <Menu.Item as="a" href={item} key={i} name={item} />
})
}
</Responsive>
<Menu.Menu position="right">
<Menu.Item>
<Button color="blue" basic inverted>
Sign in / Register
</Button>
</Menu.Item>
</Menu.Menu>
</Container>
</Menu>
{this.props.children}
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment