2018-11-20 11:59:50 -05:00
|
|
|
const PropTypes = require('prop-types');
|
|
|
|
const React = require('react');
|
|
|
|
const classNames = require('classnames');
|
|
|
|
const FlexRow = require('../../components/flex-row/flex-row.jsx');
|
|
|
|
const Button = require('../../components/forms/button.jsx');
|
|
|
|
|
|
|
|
require('./banner.scss');
|
|
|
|
|
|
|
|
const Banner = ({className, message, actionMessage, onAction}) => (
|
|
|
|
<div className={classNames('banner-outer', className)}>
|
|
|
|
<FlexRow className="inner banner-inner">
|
|
|
|
<span className="banner-text">
|
|
|
|
{message}
|
|
|
|
</span>
|
|
|
|
{actionMessage && onAction && (
|
|
|
|
<Button
|
2018-12-02 10:59:31 -05:00
|
|
|
className="banner-button"
|
2018-11-20 11:59:50 -05:00
|
|
|
onClick={onAction}
|
|
|
|
>
|
|
|
|
{actionMessage}
|
|
|
|
</Button>
|
|
|
|
)}
|
|
|
|
</FlexRow>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
Banner.propTypes = {
|
|
|
|
actionMessage: PropTypes.node,
|
|
|
|
className: PropTypes.string,
|
|
|
|
message: PropTypes.node.isRequired,
|
|
|
|
onAction: PropTypes.func
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = Banner;
|