Blame view

imports/ui/components/app-navigation.js 783 Bytes
2b1ad7917   tmcdeveloper   wip moving to Met...
1
  import React from 'react';
76dd62c7b   tmcdeveloper   fix eslint error ...
2
  import { Navbar } from 'react-bootstrap';
f7c1860b5   tmcdeveloper   add basic accepta...
3
  import { Link } from 'react-router';
2b1ad7917   tmcdeveloper   wip moving to Met...
4
5
6
7
  import { PublicNavigation } from './public-navigation';
  import { AuthenticatedNavigation } from './authenticated-navigation';
  
  export class AppNavigation extends React.Component {
f0c912bf1   tmcdeveloper   add method tests ...
8
    renderNavigation(hasUser) {
b9fec275b   tmcdeveloper   add fix for activ...
9
      return hasUser ? <AuthenticatedNavigation /> : <PublicNavigation />;
2b1ad7917   tmcdeveloper   wip moving to Met...
10
11
12
13
14
15
    }
  
    render() {
      return <Navbar>
        <Navbar.Header>
          <Navbar.Brand>
f7c1860b5   tmcdeveloper   add basic accepta...
16
            <Link to="/">Application Name</Link>
2b1ad7917   tmcdeveloper   wip moving to Met...
17
          </Navbar.Brand>
f7c1860b5   tmcdeveloper   add basic accepta...
18
          <Navbar.Toggle />
2b1ad7917   tmcdeveloper   wip moving to Met...
19
        </Navbar.Header>
f7c1860b5   tmcdeveloper   add basic accepta...
20
        <Navbar.Collapse>
f0c912bf1   tmcdeveloper   add method tests ...
21
          { this.renderNavigation(this.props.hasUser) }
f7c1860b5   tmcdeveloper   add basic accepta...
22
        </Navbar.Collapse>
2b1ad7917   tmcdeveloper   wip moving to Met...
23
24
25
      </Navbar>;
    }
  }
76dd62c7b   tmcdeveloper   fix eslint error ...
26
27
28
29
  
  AppNavigation.propTypes = {
    hasUser: React.PropTypes.object,
  };