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

69 lines
1.6 KiB
React
Raw Normal View History

2017-11-17 19:52:48 +08:00
import React, { Component } from 'react';
import { injectIntl, defineMessages } from 'react-intl';
2021-11-10 00:20:34 +08:00
import Styled 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 (
2021-11-10 00:20:34 +08:00
<Styled.Help>
<Styled.Text>
{ helpMessage }
2021-11-10 00:20:34 +08:00
</Styled.Text>
<Styled.EnterAudio>
<Styled.BackButton
2017-11-17 19:52:48 +08:00
label={intl.formatMessage(intlMessages.backLabel)}
size="md"
color="primary"
2017-11-17 19:52:48 +08:00
onClick={handleBack}
ghost
/>
2021-11-10 00:20:34 +08:00
</Styled.EnterAudio>
</Styled.Help>
);
2017-11-17 19:52:48 +08:00
}
}
2017-11-17 19:52:48 +08:00
export default injectIntl(Help);