2019-04-11 04:51:06 +08:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2020-05-26 04:00:13 +08:00
|
|
|
import { injectIntl, defineMessages } from 'react-intl';
|
2021-11-09 20:53:41 +08:00
|
|
|
import Styled from './styles';
|
2019-04-11 04:51:06 +08:00
|
|
|
|
|
|
|
const intlMessages = defineMessages({
|
|
|
|
audioDialDescription: {
|
|
|
|
id: 'app.audioDial.audioDialDescription',
|
2019-04-17 01:04:23 +08:00
|
|
|
description: 'Text description for the audio help',
|
2019-04-11 04:51:06 +08:00
|
|
|
},
|
|
|
|
audioDialConfrenceText: {
|
|
|
|
id: 'app.audioDial.audioDialConfrenceText',
|
|
|
|
description: 'audio settings back button label',
|
|
|
|
},
|
2019-07-12 03:00:46 +08:00
|
|
|
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',
|
|
|
|
},
|
2019-04-11 04:51:06 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
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,
|
2019-04-11 04:51:06 +08:00
|
|
|
telVoice: PropTypes.string.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
class AudioDial extends React.PureComponent {
|
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
intl,
|
2019-04-16 00:39:36 +08:00
|
|
|
formattedDialNum,
|
2019-04-11 04:51:06 +08:00
|
|
|
telVoice,
|
|
|
|
} = this.props;
|
|
|
|
|
2021-04-09 19:44:55 +08:00
|
|
|
const formattedTelVoice = telVoice.replace(/(?=(\d{3})+(?!\d))/g, ' ');
|
|
|
|
|
2019-04-11 04:51:06 +08:00
|
|
|
return (
|
2021-11-09 20:53:41 +08:00
|
|
|
<Styled.Help>
|
|
|
|
<Styled.Text>
|
2019-04-11 04:51:06 +08:00
|
|
|
{intl.formatMessage(intlMessages.audioDialDescription)}
|
2021-11-09 20:53:41 +08:00
|
|
|
</Styled.Text>
|
|
|
|
<Styled.DialText>{formattedDialNum}</Styled.DialText>
|
|
|
|
<Styled.ConferenceText>
|
2019-04-11 04:51:06 +08:00
|
|
|
{intl.formatMessage(intlMessages.audioDialConfrenceText)}
|
2021-11-09 20:53:41 +08:00
|
|
|
</Styled.ConferenceText>
|
2024-09-12 20:42:12 +08:00
|
|
|
<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>
|
2019-07-12 03:00:46 +08:00
|
|
|
{intl.formatMessage(intlMessages.tipMessage)}
|
2021-11-09 20:53:41 +08:00
|
|
|
</Styled.TipBox>
|
|
|
|
</Styled.Help>
|
2019-04-11 04:51:06 +08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AudioDial.propTypes = propTypes;
|
|
|
|
export default injectIntl(AudioDial);
|