bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/notifications-bar/component.jsx

37 lines
797 B
React
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import injectWbResizeEvent from '/imports/ui/components/presentation/resize-wrapper/component';
2018-01-08 14:17:18 +08:00
import { styles } from './styles.scss';
const COLORS = [
'default', 'primary', 'danger', 'success',
];
const propTypes = {
children: PropTypes.string.isRequired,
color: PropTypes.oneOf(COLORS),
};
const defaultProps = {
color: 'default',
};
const NotificationsBar = (props) => {
const { color } = props;
return (
<div
role="alert"
className={cx(styles.notificationsBar, styles[color])}
>
{props.children}
</div>
);
};
NotificationsBar.propTypes = propTypes;
NotificationsBar.defaultProps = defaultProps;
export default injectWbResizeEvent(NotificationsBar);