Skip to content

Commit

Permalink
Added Header component for reuse of <header> on MovieBrowser and Movi…
Browse files Browse the repository at this point in the history
…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.
28 changes: 28 additions & 0 deletions src/primitives/Header.js
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;

0 comments on commit acdce32

Please sign in to comment.