35 lines
937 B
JavaScript
35 lines
937 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { Navbar } from 'react-bootstrap';
|
|
import { Link } from 'react-router-dom';
|
|
import PublicNavigation from '../PublicNavigation/PublicNavigation';
|
|
import AuthenticatedNavigation from '../AuthenticatedNavigation/AuthenticatedNavigation';
|
|
import { translate } from 'react-i18next';
|
|
|
|
import './Navigation.scss';
|
|
|
|
const Navigation = props => (
|
|
<Navbar>
|
|
<Navbar.Header>
|
|
<Navbar.Brand>
|
|
<Link to="/">{props.t('AppName')}</Link>
|
|
</Navbar.Brand>
|
|
<Navbar.Toggle />
|
|
</Navbar.Header>
|
|
<Navbar.Collapse>
|
|
{!props.authenticated ? <PublicNavigation /> : <AuthenticatedNavigation {...props} />}
|
|
</Navbar.Collapse>
|
|
</Navbar>
|
|
);
|
|
|
|
Navigation.defaultProps = {
|
|
name: '',
|
|
};
|
|
|
|
Navigation.propTypes = {
|
|
authenticated: PropTypes.bool.isRequired,
|
|
};
|
|
|
|
// export default Navigation;
|
|
|
|
export default translate([], { wait: true })(Navigation);
|