aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/components/Navigation.js
blob: 95693d81e0a7b9bff76a0f88737f42c336c5d91b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import React from 'react';

export default class Navigation extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      visitor: {uid: 0}
    }
    this.transition = this.transition.bind(this);
  }  
  transition(event) {
    event.preventDefault();
    this.props.onNavigate({ pathname: event.currentTarget.pathname, search: event.currentTarget.search});
  };
  render() {
    return (
     	<header>
        <div id="header_wrapper">
        <div id="logo"><a href="/" onClick={this.transition}>Juick</a></div>
        <nav id="global">
            <ul>
                { this.state.visitor.uid ? 
                <li><a href="/?show=discuss" onClick={this.transition}><i data-icon="ei-comment" data-size="s"></i>Discuss</a></li>
		 : 
                <li><a href="/?show=photos" rel="nofollow" onClick={this.transition}><i data-icon="ei-camera" data-size="s"></i>Photos</a></li>
                 }
                <li><a href="/?show=all" rel="nofollow" onClick={this.transition}><i data-icon="ei-search" data-size="s"></i>Discover</a></li>
                <li><a id="post" href="/post" onClick={this.transition}><i data-icon="ei-pencil" data-size="s"></i>Post</a>
                </li>
            </ul>
        </nav>
        <div id="search">
            <form action="/">
                <input name="search" className="text"
                       placeholder="Search..." />
            </form>
        </div>
        </div>
        </header>
    )
  }
}