-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Header component for reuse of <header> on MovieBrowser and Movi…
…eWishlist
- Loading branch information
Erin Doyle
committed
Sep 2, 2018
1 parent
4b52d85
commit acdce32
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
|
||
const Header = ({ title, buttonText, handleButtonClick }) => ( | ||
<header> | ||
<nav className="navbar navbar-dark bg-primary"> | ||
<span className="navbar-text"> | ||
<h1>{title}</h1> | ||
</span> | ||
<button className="btn btn-outline-secondary" onClick={handleButtonClick}>{buttonText}</button> | ||
</nav> | ||
</header> | ||
); | ||
|
||
Header.defaultProps = { | ||
buttonText: '', | ||
handleButtonClick: () => {} | ||
}; | ||
|
||
Header.propTypes = { | ||
title: PropTypes.string.isRequired, | ||
buttonText: PropTypes.string, | ||
handleButtonClick: PropTypes.func | ||
}; | ||
|
||
|
||
export default Header; |