bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/video-dock/video-menu/component.jsx

50 lines
1.3 KiB
React
Raw Normal View History

2017-09-20 11:12:10 +08:00
import React from 'react';
import PropTypes from 'prop-types';
2017-09-20 11:12:10 +08:00
import Button from '/imports/ui/components/button/component';
import { defineMessages, injectIntl, intlShape } from 'react-intl';
2017-09-20 11:12:10 +08:00
const intlMessages = defineMessages({
joinVideo: {
id: 'app.video.joinVideo',
description: 'Join video button label',
},
leaveVideo: {
id: 'app.video.leaveVideo',
description: 'Leave video button label',
},
});
2018-01-17 00:04:34 +08:00
const JoinVideoOptions = ({intl, isWaitingResponse, isConnected, isSharingVideo, handleJoinVideo, handleCloseVideo}) => {
if (isSharingVideo) {
2017-09-20 11:12:10 +08:00
return (
<Button
2018-01-17 00:04:34 +08:00
onClick={handleCloseVideo}
label={intl.formatMessage(intlMessages.leaveVideo)}
hideLabel
2018-01-17 00:04:34 +08:00
aria-label={intl.formatMessage(intlMessages.leaveVideo)}
color={'danger'}
icon={'video'}
2017-09-20 11:12:10 +08:00
size={'lg'}
circle
2018-01-17 00:04:34 +08:00
disabled={isWaitingResponse}
2017-09-20 11:12:10 +08:00
/>
);
}
2018-01-17 00:04:34 +08:00
return (
<Button
onClick={handleJoinVideo}
label={intl.formatMessage(intlMessages.joinVideo)}
hideLabel
aria-label={intl.formatMessage(intlMessages.joinVideo)}
color={'primary'}
icon={'video_off'}
size={'lg'}
circle
disabled={isWaitingResponse || (!isSharingVideo && isConnected)}
/>
);
}
2017-09-20 11:12:10 +08:00
export default injectIntl(JoinVideoOptions);