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