aboutsummaryrefslogtreecommitdiff
path: root/vnext/src/app.js
blob: 82209e45bf59b43aedf4d9c65daab2425c81b506 (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
43
44
45
46
47
48
49
50
51
import React from "react"
import ReactDOM from "react-dom"
import { BrowserRouter as Router, Route, Link } from "react-router-dom"

import Discover from "./components/Discover"
import Post from "./components/Post"

class App extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      visitor: { uid: 0 }
    }
  }
  render() {
    return (
      <Router>
        <div className="wrapper">
          <header>
            <div id="header_wrapper">
              <div id="logo"><Link to="/">Juick</Link></div>
              <nav id="global">
                <ul>
                  {this.state.visitor.uid ?
                    <li><Link to="/?show=discuss"><i data-icon="ei-comment" data-size="s"></i>Discuss</Link></li>
                    :
                    <li><Link to="/?show=photos" rel="nofollow"><i data-icon="ei-camera" data-size="s"></i>Photos</Link></li>
                  }
                  <li><Link to="/?show=all" rel="nofollow"><i data-icon="ei-search" data-size="s"></i>Discover</Link></li>
                  <li><Link to="post" href="/post"><i data-icon="ei-pencil" data-size="s"></i>Post</Link>
                  </li>
                </ul>
              </nav>
              <div id="search">
                <form action="/">
                  <input name="search" className="text"
                    placeholder="Search..." />
                </form>
              </div>
            </div>
          </header>
          <Route exact path="/" component={Discover} />
          <Route path="/post" component={Post} />
        </div>
      </Router>
    )
  }
}


ReactDOM.render(<App />, document.getElementById("wrapper"));