Blame view

imports/client/views/app/module/navigation/AppNavigation.js 729 Bytes
3540345c5   themeteorchef   handful of fixes
1
2
3
  import React from 'react';
  import { Navbar } from 'react-bootstrap';
  import { Link } from 'react-router';
c42d4eeac   themeteorchef   handful of changes
4
5
  import PublicNavigation from './PublicNavigation.js';
  import AuthenticatedNavigation from './AuthenticatedNavigation.js';
3540345c5   themeteorchef   handful of fixes
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  
  const renderNavigation = hasUser => (hasUser ? <AuthenticatedNavigation /> : <PublicNavigation />);
  
  const AppNavigation = ({ hasUser }) => (
    <Navbar>
      <Navbar.Header>
        <Navbar.Brand>
          <Link to="/">Application Name</Link>
        </Navbar.Brand>
        <Navbar.Toggle />
      </Navbar.Header>
      <Navbar.Collapse>
        { renderNavigation(hasUser) }
      </Navbar.Collapse>
    </Navbar>
  );
  
  AppNavigation.propTypes = {
    hasUser: React.PropTypes.object,
  };
  
  export default AppNavigation;