-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathNavBar.js
More file actions
37 lines (32 loc) · 761 Bytes
/
NavBar.js
File metadata and controls
37 lines (32 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from 'react';
import { Route } from 'react-router-dom';
import styled from 'styled-components'
import PropTypes from 'prop-types';
import NavLinks from './NavLinks';
import SubNav from './SubNav';
const Header = styled.header `
background: black;
opacity: .80;
display: flex;
flex-flow: row nowrap;
justify-content: space-around;
align-items: center;
`
const NavBar = (props) => {
return (
<React.Fragment>
<Header>
<NavLinks list={props.list} handleClick={props.handleClick} />
</Header>
<Route
path={'/:category'}
render={({match})=>
<SubNav {...props} list={props.list} match={match}/>}
/>
</React.Fragment>
)
}
export default NavBar
NavBar.propTypes = {
list: PropTypes.array
}