2020-04-01 07:47:51 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { translate } from '../../../../base/i18n';
|
2021-02-24 09:37:14 +00:00
|
|
|
import { connect } from '../../../../base/redux';
|
2021-03-03 14:45:26 +00:00
|
|
|
import { getDialInfoPageURL, hasMultipleNumbers } from '../../../functions';
|
2020-04-01 07:47:51 +00:00
|
|
|
|
|
|
|
import DialInNumber from './DialInNumber';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
2021-03-16 15:59:33 +00:00
|
|
|
* The numeric identifier for the current conference, used after dialing a
|
2021-03-03 14:45:26 +00:00
|
|
|
* the number to join the conference.
|
2020-04-01 07:47:51 +00:00
|
|
|
*/
|
2021-03-03 14:45:26 +00:00
|
|
|
_conferenceID: number,
|
2020-04-01 07:47:51 +00:00
|
|
|
|
|
|
|
/**
|
2021-02-24 09:37:14 +00:00
|
|
|
* The url of the page containing the dial-in numbers list.
|
2020-04-01 07:47:51 +00:00
|
|
|
*/
|
2021-02-24 09:37:14 +00:00
|
|
|
_dialInfoPageUrl: string,
|
2020-04-01 07:47:51 +00:00
|
|
|
|
2021-03-03 14:45:26 +00:00
|
|
|
/**
|
2021-11-04 21:10:43 +00:00
|
|
|
* If multiple dial-in numbers are available.
|
2021-03-03 14:45:26 +00:00
|
|
|
*/
|
|
|
|
_hasMultipleNumbers: boolean;
|
|
|
|
|
2020-04-01 07:47:51 +00:00
|
|
|
/**
|
|
|
|
* The phone number to dial to begin the process of dialing into a
|
|
|
|
* conference.
|
|
|
|
*/
|
|
|
|
phoneNumber: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invoked to obtain translated strings.
|
|
|
|
*/
|
|
|
|
t: Function
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a ReactElement for showing how to dial into the conference, if
|
|
|
|
* dialing in is available.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {null|ReactElement}
|
|
|
|
*/
|
|
|
|
function DialInSection({
|
2021-03-03 14:45:26 +00:00
|
|
|
_conferenceID,
|
2021-02-24 09:37:14 +00:00
|
|
|
_dialInfoPageUrl,
|
2021-03-03 14:45:26 +00:00
|
|
|
_hasMultipleNumbers,
|
2020-04-01 07:47:51 +00:00
|
|
|
phoneNumber,
|
|
|
|
t
|
|
|
|
}: Props) {
|
|
|
|
return (
|
|
|
|
<div className = 'invite-more-dialog dial-in-display'>
|
|
|
|
<DialInNumber
|
2021-03-03 14:45:26 +00:00
|
|
|
conferenceID = { _conferenceID }
|
2020-04-01 07:47:51 +00:00
|
|
|
phoneNumber = { phoneNumber } />
|
2021-03-03 14:45:26 +00:00
|
|
|
{_hasMultipleNumbers ? <a
|
2020-04-01 07:47:51 +00:00
|
|
|
className = 'more-numbers'
|
2021-02-24 09:37:14 +00:00
|
|
|
href = { _dialInfoPageUrl }
|
2020-04-01 07:47:51 +00:00
|
|
|
rel = 'noopener noreferrer'
|
|
|
|
target = '_blank'>
|
|
|
|
{ t('info.moreNumbers') }
|
2021-03-03 14:45:26 +00:00
|
|
|
</a> : null}
|
2020-04-01 07:47:51 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2021-02-24 09:37:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps (parts of) the Redux state to the associated props for the
|
|
|
|
* {@code DialInLink} component.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The Redux state.
|
|
|
|
* @private
|
|
|
|
* @returns {Props}
|
|
|
|
*/
|
|
|
|
function _mapStateToProps(state) {
|
2021-03-03 14:45:26 +00:00
|
|
|
const dialIn = state['features/invite'];
|
|
|
|
|
2021-02-24 09:37:14 +00:00
|
|
|
return {
|
2021-03-03 14:45:26 +00:00
|
|
|
_conferenceID: dialIn.conferenceID,
|
|
|
|
_dialInfoPageUrl: getDialInfoPageURL(state),
|
|
|
|
_hasMultipleNumbers: hasMultipleNumbers(dialIn.numbers)
|
2021-02-24 09:37:14 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(connect(_mapStateToProps)(DialInSection));
|