bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/video-provider/fullscreen-button/component.jsx

54 lines
1.3 KiB
React
Raw Normal View History

import React from 'react';
2019-02-08 01:47:28 +08:00
import { defineMessages, injectIntl, intlShape } from 'react-intl';
import Button from '/imports/ui/components/button/component';
2019-01-15 21:13:55 +08:00
import cx from 'classnames';
2019-02-08 01:47:28 +08:00
import PropTypes from 'prop-types';
import { styles } from './styles';
const intlMessages = defineMessages({
fullscreenButton: {
id: 'app.fullscreenButton.label',
description: 'Fullscreen label',
},
});
2019-02-08 01:47:28 +08:00
const propTypes = {
intl: intlShape.isRequired,
handleFullscreen: PropTypes.func.isRequired,
dark: PropTypes.bool,
elementName: PropTypes.string,
};
const defaultProps = {
dark: false,
elementName: '',
};
const FullscreenButtonComponent = ({
2019-02-08 01:47:28 +08:00
intl, handleFullscreen, dark, elementName,
}) => {
const formattedLabel = intl.formatMessage(
intlMessages.fullscreenButton,
({ 0: elementName || '' }),
);
return (
2019-02-09 02:29:32 +08:00
<div className={cx(styles.wrapper, dark ? styles.dark : styles.light)}>
<Button
color="default"
icon="fullscreen"
size="sm"
onClick={handleFullscreen}
label={formattedLabel}
hideLabel
2019-02-12 21:35:52 +08:00
className={cx(styles.button, styles.fullScreenButton)}
/>
</div>
);
};
2019-02-08 01:47:28 +08:00
FullscreenButtonComponent.propTypes = propTypes;
FullscreenButtonComponent.defaultProps = defaultProps;
export default injectIntl(FullscreenButtonComponent);