bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/audio-controls/component.jsx

52 lines
1.3 KiB
React
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import Button from '/imports/ui/components/button/component';
import styles from './styles';
const propTypes = {
handleToggleMuteMicrophone: PropTypes.func.isRequired,
handleJoinAudio: PropTypes.func.isRequired,
handleLeaveAudio: PropTypes.func.isRequired,
2017-10-23 20:41:09 +08:00
disable: PropTypes.bool.isRequired,
unmute: PropTypes.bool.isRequired,
mute: PropTypes.bool.isRequired,
join: PropTypes.bool.isRequired,
};
const AudioControls = ({
handleToggleMuteMicrophone,
handleJoinAudio,
handleLeaveAudio,
mute,
unmute,
2017-10-20 18:11:51 +08:00
disable,
join,
}) => (
<span className={styles.container}>
{mute ?
<Button
className={styles.button}
onClick={handleToggleMuteMicrophone}
2017-10-23 20:41:09 +08:00
disabled={disable}
label={unmute ? 'Unmute' : 'Mute'}
color={'primary'}
icon={unmute ? 'mute' : 'unmute'}
size={'lg'}
circle
/> : null}
<Button
className={styles.button}
onClick={join ? handleLeaveAudio : handleJoinAudio}
2017-10-23 20:41:09 +08:00
disabled={disable}
label={join ? 'Leave Audio' : 'Join Audio'}
color={join ? 'danger' : 'primary'}
icon={join ? 'audio_off' : 'audio_on'}
size={'lg'}
circle
/>
</span>);
AudioControls.propTypes = propTypes;
export default AudioControls;