colouring-montreal/app/src/frontend/info-box.tsx

30 lines
823 B
TypeScript
Raw Normal View History

2018-09-13 15:41:42 -04:00
import React, { Fragment } from 'react';
2019-05-27 13:26:29 -04:00
import PropTypes from 'prop-types';
2018-09-13 15:41:42 -04:00
const InfoBox = (props) => (
<Fragment>
{
(props.msg || props.children)?
2019-05-27 11:39:16 -04:00
(
<div className="alert alert-info" role="alert">
{
(typeof props.msg === 'string' || props.msg instanceof String)?
props.msg
: 'Enjoy the colouring! Usual service should resume shortly.'
}
{
props.children
}
</div>
) : null
2018-09-13 15:41:42 -04:00
}
</Fragment>
);
2019-05-27 13:26:29 -04:00
InfoBox.propTypes = {
msg: PropTypes.string,
children: PropTypes.node
}
2018-09-13 15:41:42 -04:00
export default InfoBox;