bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/notifications-bar/component.jsx
Oleksandr Zhurbenko f80d0bc083 Linting and moved whiteboard resize events into HoC
Thus we won't clutter the code with unrelated events and can easily switch to a ResizeObserver when it is implemented by the browsers
2017-09-25 16:45:44 -07:00

37 lines
793 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import injectWbResizeEvent from '/imports/ui/components/presentation/resize-wrapper/component';
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);