bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/connection-status/icon/component.jsx
Pedro Beschorner Marin 3672a909f1 style(connection status): replace icons
Replace previous icon with a flexible version to fit inside other
nodes (e.g: buttons).
2021-04-23 06:32:11 -03:00

40 lines
915 B
JavaScript

import React, { Fragment } from 'react';
import cx from 'classnames';
import { styles } from './styles';
const STATS = {
critical: {
color: styles.critical,
bars: styles.oneBar,
},
danger: {
color: styles.danger,
bars: styles.twoBars,
},
warning: {
color: styles.warning,
bars: styles.threeBars,
},
normal: {
color: styles.normal,
bars: styles.fourBars,
},
};
const Icon = ({ level, grayscale }) => {
const color = grayscale ? styles.normal : STATS[level].color;
return (
<Fragment>
<div className={cx(styles.signalBars, color, STATS[level].bars)}>
<div className={cx(styles.firstBar, styles.bar)} />
<div className={cx(styles.secondBar, styles.bar)} />
<div className={cx(styles.thirdBar, styles.bar)} />
<div className={cx(styles.fourthBar, styles.bar)} />
</div>
</Fragment>
);
};
export default Icon;