bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/audio/help/component.jsx

71 lines
1.7 KiB
React
Raw Normal View History

2017-11-17 19:52:48 +08:00
import React, { Component } from 'react';
import Button from '/imports/ui/components/button/component';
import { injectIntl, defineMessages } from 'react-intl';
2018-01-08 14:17:18 +08:00
import { styles } from './styles';
2017-11-17 19:52:48 +08:00
const intlMessages = defineMessages({
descriptionHelp: {
id: 'app.audioModal.helpText',
description: 'Text decription for the audio help',
},
backLabel: {
id: 'app.audio.backLabel',
description: 'audio settings back button label',
},
noSSL: {
id: 'app.audioModal.help.noSSL',
description: 'Text decription for domain not using https',
},
macNotAllowed: {
id: 'app.audioModal.help.macNotAllowed',
description: 'Text decription for mac needed to enable OS setting',
},
});
2017-11-17 19:52:48 +08:00
class Help extends Component {
render() {
const {
intl,
handleBack,
2019-09-30 22:54:34 +08:00
audioErr,
2017-11-17 19:52:48 +08:00
} = this.props;
2019-09-30 22:54:34 +08:00
const { code, MIC_ERROR } = audioErr;
let helpMessage = null;
2019-09-30 22:54:34 +08:00
switch (code) {
case MIC_ERROR.NO_SSL:
helpMessage = intl.formatMessage(intlMessages.noSSL);
break;
2019-09-30 22:54:34 +08:00
case MIC_ERROR.MAC_OS_BLOCK:
helpMessage = intl.formatMessage(intlMessages.macNotAllowed);
break;
2019-09-30 22:54:34 +08:00
case MIC_ERROR.NO_PERMISSION:
default:
helpMessage = intl.formatMessage(intlMessages.descriptionHelp);
break;
}
2017-11-17 19:52:48 +08:00
return (
<span className={styles.help}>
<div className={styles.text}>
{ helpMessage }
2017-11-17 19:52:48 +08:00
</div>
<div className={styles.enterAudio}>
<Button
className={styles.backBtn}
label={intl.formatMessage(intlMessages.backLabel)}
size="md"
color="primary"
2017-11-17 19:52:48 +08:00
onClick={handleBack}
ghost
/>
</div>
</span>
);
2017-11-17 19:52:48 +08:00
}
}
2017-11-17 19:52:48 +08:00
export default injectIntl(Help);