bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/video-provider/video-menu/component.jsx
2019-01-02 17:31:23 -03:00

61 lines
1.6 KiB
JavaScript
Executable File

import React from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';
import cx from 'classnames';
import Button from '/imports/ui/components/button/component';
import { defineMessages, injectIntl, intlShape } from 'react-intl';
import { styles } from './styles';
const intlMessages = defineMessages({
videoMenu: {
id: 'app.video.videoMenu',
description: 'video menu label',
},
videoMenuDesc: {
id: 'app.video.videoMenuDesc',
description: 'video menu description',
},
videoMenuDisabled: {
id: 'app.video.videoMenuDisabled',
description: 'video menu label',
},
});
const propTypes = {
intl: intlShape.isRequired,
isSharingVideo: PropTypes.bool.isRequired,
videoItems: PropTypes.arrayOf(PropTypes.object).isRequired,
};
const JoinVideoOptions = ({
intl,
isSharingVideo,
videoShareAllowed,
handleJoinVideo,
handleCloseVideo,
}) => {
return (
<Button
label={!videoShareAllowed ?
intl.formatMessage(intlMessages.videoMenuDisabled)
:
intl.formatMessage(intlMessages.videoMenu)
}
className={cx(styles.button, isSharingVideo || styles.ghostButton)}
onClick={isSharingVideo ? handleCloseVideo : handleJoinVideo}
hideLabel
aria-label={intl.formatMessage(intlMessages.videoMenuDesc)}
color={isSharingVideo ? 'primary' : 'default'}
icon={isSharingVideo ? 'video' : 'video_off'}
ghost={!isSharingVideo}
size="lg"
circle
disabled={!videoShareAllowed}
/>
);
};
JoinVideoOptions.propTypes = propTypes;
export default injectIntl(JoinVideoOptions);