Skip to content

Commit 000516e

Browse files
authored
Merge pull request #111 from scientist-softserv/110-header-component-restructure
Update header to be responsive
2 parents 66aec75 + 13cfb9d commit 000516e

File tree

7 files changed

+24
-98
lines changed

7 files changed

+24
-98
lines changed

src/compounds/Header/Header.jsx

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
3-
import NavLink from '../NavLink/NavLink'
3+
import { Container, Nav, Navbar } from 'react-bootstrap'
44
import Logo from '../Logo/Logo'
5-
import './header.css'
65

76
// may come back to hard code these
87

98
const Header = ({ browseLink, logInLink, logo, logOutLink, requestsLink, user }) => {
109
const { src, alt } = logo
1110

1211
return (
13-
<header className='header-container'>
14-
<div className='webstore-container container'>
15-
<Logo src={src} alt={alt} />
16-
<div>
17-
<NavLink href={browseLink} label='Browse' />
18-
<NavLink href={requestsLink} label='Requests' />
19-
{user ? (
20-
<NavLink href={logOutLink} label='Log Out' />
21-
) : (
22-
<NavLink href={logInLink} label='Log In' />
23-
)}
24-
</div>
25-
</div>
26-
</header>
12+
<Navbar bg='secondary' expand='lg'>
13+
<Container>
14+
<Navbar.Brand className='w-50'>
15+
<Logo src={src} alt={alt} height={45} />
16+
</Navbar.Brand>
17+
<Navbar.Toggle aria-controls='basic-navbar-nav' />
18+
<Navbar.Collapse id='basic-navbar-nav'>
19+
<Nav className='ms-auto'>
20+
<Nav.Link href={browseLink} className='link-dark'>Browse</Nav.Link>
21+
<Nav.Link href={requestsLink} className='link-dark'>Requests</Nav.Link>
22+
{user ? (
23+
<Nav.Link href={logOutLink} className='link-dark'>Log Out</Nav.Link>
24+
) : (
25+
<Nav.Link href={logInLink} className='link-dark'>Log In</Nav.Link>
26+
)}
27+
</Nav>
28+
</Navbar.Collapse>
29+
</Container>
30+
</Navbar>
2731
)
2832
}
2933

src/compounds/Header/header.css

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/compounds/Logo/Logo.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,23 @@ import React from 'react'
22
import PropTypes from 'prop-types'
33
import Image from '../../components/Image/Image'
44

5-
const Logo = ({ alt, src, height }) => (
5+
const Logo = ({ addClass, alt, src, height }) => (
66
<a href='/'>
7-
<Image src={src} alt={alt} height={height} />
7+
<Image src={src} alt={alt} height={height} addClass={addClass} />
88
</a>
99
)
1010

1111
Logo.propTypes = {
12+
addClass: PropTypes.string,
1213
alt: PropTypes.string,
1314
src: PropTypes.string.isRequired,
1415
height: PropTypes.number,
1516
}
1617

1718
Logo.defaultProps = {
19+
addClass: '',
1820
alt: '',
1921
height: 50,
2022
}
2123

22-
Logo.defaultProps = {
23-
alt: '',
24-
}
25-
2624
export default Logo

src/compounds/NavLink/NavLink.jsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/compounds/NavLink/NavLink.stories.jsx

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/compounds/NavLink/nav-link.css

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/compounds/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import LinkGroup from './LinkGroup/LinkGroup'
1515
import LinkedButton from './LinkedButton/LinkedButton'
1616
import Logo from './Logo/Logo'
1717
import Messages from './Messages/Messages'
18-
import NavLink from './NavLink/NavLink'
1918
import RequestItem from './RequestItem/RequestItem'
2019
import RequestList from './RequestList/RequestList'
2120
import RequestStats from './RequestStats/RequestStats'
@@ -34,7 +33,6 @@ export {
3433
LinkedButton,
3534
Logo,
3635
Messages,
37-
NavLink,
3836
RequestItem,
3937
RequestList,
4038
RequestStats,

0 commit comments

Comments
 (0)