33 lines
869 B
JavaScript
33 lines
869 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 './Navigation.scss';
|
|
|
|
const Navigation = ({ authenticated, name }) => (
|
|
<Navbar>
|
|
<Navbar.Header>
|
|
<Navbar.Brand>
|
|
<Link to="/">Pup</Link>
|
|
</Navbar.Brand>
|
|
<Navbar.Toggle />
|
|
</Navbar.Header>
|
|
<Navbar.Collapse>
|
|
{!authenticated ? <PublicNavigation /> : <AuthenticatedNavigation name={name} />}
|
|
</Navbar.Collapse>
|
|
</Navbar>
|
|
);
|
|
|
|
Navigation.defaultProps = {
|
|
name: PropTypes.string,
|
|
};
|
|
|
|
Navigation.propTypes = {
|
|
authenticated: PropTypes.bool.isRequired,
|
|
name: PropTypes.string,
|
|
};
|
|
|
|
export default Navigation;
|