bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/autoplay/component.jsx
Vitor Mateus De Almeida 145ca61d40 linting some files
2021-08-09 11:24:02 -03:00

51 lines
1.3 KiB
JavaScript

import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import Button from '/imports/ui/components/button/component';
import { defineMessages, injectIntl } from 'react-intl';
import { styles } from './styles';
const intlMessages = defineMessages({
confirmLabel: {
id: 'app.audioModal.playAudio',
description: 'Play audio prompt for autoplay',
},
confirmAriaLabel: {
id: 'app.audioModal.playAudio.arialabel',
description: 'Provides better context for play audio prompt btn label',
},
});
const propTypes = {
handleAllowAutoplay: PropTypes.func.isRequired,
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
}).isRequired,
};
class AudioAutoplayPrompt extends PureComponent {
render() {
const {
intl,
handleAllowAutoplay,
} = this.props;
return (
<span className={styles.autoplayPrompt}>
<Button
className={styles.button}
label={intl.formatMessage(intlMessages.confirmLabel)}
aria-label={intl.formatMessage(intlMessages.confirmAriaLabel)}
icon="thumbs_up"
circle
color="success"
size="jumbo"
onClick={handleAllowAutoplay}
/>
</span>
);
}
}
export default injectIntl(AudioAutoplayPrompt);
AudioAutoplayPrompt.propTypes = propTypes;