bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/media/autoplay-overlay/component.jsx

54 lines
1.4 KiB
React
Raw Normal View History

import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
2022-02-15 04:20:50 +08:00
import Button from '/imports/ui/components/common/button/component';
2021-10-30 00:35:08 +08:00
import Styled from './styles';
const propTypes = {
autoplayBlockedDesc: PropTypes.string.isRequired,
autoplayAllowLabel: PropTypes.string.isRequired,
handleAllowAutoplay: PropTypes.func.isRequired,
intl: PropTypes.objectOf(Object).isRequired,
};
const intlMessages = defineMessages({
autoplayAlertDesc: {
id: 'app.media.autoplayAlertDesc',
description: 'Description for the autoplay alert title',
},
});
class AutoplayOverlay extends PureComponent {
render() {
const {
intl,
handleAllowAutoplay,
autoplayBlockedDesc,
autoplayAllowLabel,
} = this.props;
return (
2021-10-30 00:35:08 +08:00
<Styled.AutoplayOverlay>
<Styled.Title>
{ intl.formatMessage(intlMessages.autoplayAlertDesc) }
2021-10-30 00:35:08 +08:00
</Styled.Title>
<Styled.AutoplayOverlayContent>
<Styled.Label>
{autoplayBlockedDesc}
2021-10-30 00:35:08 +08:00
</Styled.Label>
<Button
color="primary"
label={autoplayAllowLabel}
onClick={handleAllowAutoplay}
role="button"
size="lg"
/>
2021-10-30 00:35:08 +08:00
</Styled.AutoplayOverlayContent>
</Styled.AutoplayOverlay>
);
}
}
AutoplayOverlay.propTypes = propTypes;
export default injectIntl(AutoplayOverlay);