Fakultas Ilmu Komputer UI

TopMenu.jsx 778 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import React from 'react';
import { Menu, Image } from 'semantic-ui-react';
import { Link } from 'react-router';
import Server from './../lib/server';

export default class TopMenu extends React.Component {
  state = { activeItem: 'home' };

  render() {
    return (
      <Menu pointing secondary>
        <Image as="a" size="small" src="/assets/img/logo.png" href="/" />
        <Menu.Menu position="right">
          <Menu.Item as={Link} to="/home" name="home" />
          <Menu.Item as={Link} to="/profile" name="profil" />
          {Server.isLoggedIn() ?
            <Menu.Item as={Link} href="/api/api-auth/logout/?next=/" name="logout" /> :
            <Menu.Item as={Link} to="/login" name="login" />
                }
        </Menu.Menu>
      </Menu>
    );
  }
}