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

66 lines
1.8 KiB
React
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import { injectIntl, defineMessages } from 'react-intl';
2021-11-09 20:53:41 +08:00
import Styled from './styles';
const intlMessages = defineMessages({
audioDialDescription: {
id: 'app.audioDial.audioDialDescription',
2019-04-17 01:04:23 +08:00
description: 'Text description for the audio help',
},
audioDialConfrenceText: {
id: 'app.audioDial.audioDialConfrenceText',
description: 'audio settings back button label',
},
tipIndicator: {
id: 'app.audioDial.tipIndicator',
description: 'Indicator for the tip message',
},
tipMessage: {
id: 'app.audioDial.tipMessage',
description: 'Tip message explaining how to mute/unmute yourself',
},
});
const propTypes = {
2021-08-09 22:24:02 +08:00
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
}).isRequired,
2019-04-16 00:39:36 +08:00
formattedDialNum: PropTypes.string.isRequired,
telVoice: PropTypes.string.isRequired,
};
class AudioDial extends React.PureComponent {
render() {
const {
intl,
2019-04-16 00:39:36 +08:00
formattedDialNum,
telVoice,
} = this.props;
2021-04-09 19:44:55 +08:00
const formattedTelVoice = telVoice.replace(/(?=(\d{3})+(?!\d))/g, ' ');
return (
2021-11-09 20:53:41 +08:00
<Styled.Help>
<Styled.Text>
{intl.formatMessage(intlMessages.audioDialDescription)}
2021-11-09 20:53:41 +08:00
</Styled.Text>
<Styled.DialText>{formattedDialNum}</Styled.DialText>
<Styled.ConferenceText>
{intl.formatMessage(intlMessages.audioDialConfrenceText)}
2021-11-09 20:53:41 +08:00
</Styled.ConferenceText>
<Styled.Telvoice>{`${formattedTelVoice} #`}</Styled.Telvoice>
2021-11-09 20:53:41 +08:00
<Styled.TipBox>
<Styled.TipIndicator>
2019-07-12 03:36:30 +08:00
{`${intl.formatMessage(intlMessages.tipIndicator)}: `}
2021-11-09 20:53:41 +08:00
</Styled.TipIndicator>
{intl.formatMessage(intlMessages.tipMessage)}
2021-11-09 20:53:41 +08:00
</Styled.TipBox>
</Styled.Help>
);
}
}
AudioDial.propTypes = propTypes;
export default injectIntl(AudioDial);