2022-08-25 11:35:19 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2022-09-13 07:36:00 +00:00
|
|
|
|
|
|
|
import { Theme } from '@mui/material';
|
2020-05-14 12:30:24 +00:00
|
|
|
import React from 'react';
|
2022-08-25 11:35:19 +00:00
|
|
|
import { WithTranslation } from 'react-i18next';
|
2022-09-13 07:36:00 +00:00
|
|
|
import { makeStyles } from 'tss-react/mui';
|
2020-05-20 10:57:03 +00:00
|
|
|
|
2022-08-25 11:35:19 +00:00
|
|
|
import { translate } from '../../../base/i18n/functions';
|
|
|
|
import Icon from '../../../base/icons/components/Icon';
|
2022-09-06 17:32:20 +00:00
|
|
|
import { IconArrowLeft } from '../../../base/icons/svg';
|
2022-10-13 10:42:39 +00:00
|
|
|
import { Button } from '../../../base/ui/components/web';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2020-05-14 12:30:24 +00:00
|
|
|
import { getCountryCodeFromPhone } from '../../utils';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2020-05-14 12:30:24 +00:00
|
|
|
import Label from '../Label';
|
|
|
|
|
2022-08-25 11:35:19 +00:00
|
|
|
interface Props extends WithTranslation {
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The number to call in order to join the conference.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
number: string;
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handler used when clicking the back button.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
onBack: Function;
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Click handler for primary button.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
onPrimaryButtonClick: Function;
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Click handler for the small additional text.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
onSmallTextClick: (e?: React.MouseEvent) => void;
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
/**
|
2022-08-25 11:35:19 +00:00
|
|
|
* Click handler for the text button.
|
2020-05-14 12:30:24 +00:00
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
onTextButtonClick: (e?: React.MouseEvent) => void;
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
/**
|
2022-08-25 11:35:19 +00:00
|
|
|
* The passCode of the conference.
|
2020-05-14 12:30:24 +00:00
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
passCode: string;
|
2022-08-25 11:35:19 +00:00
|
|
|
}
|
2020-05-14 12:30:24 +00:00
|
|
|
|
2022-09-13 07:36:00 +00:00
|
|
|
const useStyles = makeStyles()((theme: Theme) => {
|
2022-03-15 11:30:38 +00:00
|
|
|
return {
|
|
|
|
dialInDialog: {
|
|
|
|
textAlign: 'center',
|
|
|
|
|
|
|
|
'& .prejoin-dialog-dialin-header': {
|
|
|
|
alignItems: 'center',
|
2022-09-13 07:36:00 +00:00
|
|
|
margin: `${theme.spacing(3)} 0 ${theme.spacing(5)} ${theme.spacing(3)}`,
|
2022-03-15 11:30:38 +00:00
|
|
|
display: 'flex'
|
|
|
|
},
|
|
|
|
'& .prejoin-dialog-dialin-icon': {
|
|
|
|
marginRight: theme.spacing(3)
|
|
|
|
},
|
|
|
|
'& .prejoin-dialog-dialin-num': {
|
|
|
|
background: '#3e474f',
|
|
|
|
borderRadius: '4px',
|
|
|
|
display: 'inline-block',
|
|
|
|
fontSize: '15px',
|
|
|
|
lineHeight: '24px',
|
|
|
|
margin: theme.spacing(1),
|
|
|
|
padding: theme.spacing(2),
|
|
|
|
|
|
|
|
'& .prejoin-dialog-dialin-num-container': {
|
|
|
|
minHeight: '48px',
|
2022-09-13 07:36:00 +00:00
|
|
|
margin: `${theme.spacing(2)} 0`
|
2022-03-15 11:30:38 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .prejoin-dialog-dialin-link': {
|
|
|
|
color: '#6FB1EA',
|
|
|
|
cursor: 'pointer',
|
|
|
|
display: 'inline-block',
|
|
|
|
fontSize: '13px',
|
|
|
|
lineHeight: '20px',
|
|
|
|
marginBottom: theme.spacing(4)
|
|
|
|
},
|
|
|
|
'& .prejoin-dialog-dialin-spaced-label': {
|
|
|
|
marginBottom: theme.spacing(3),
|
|
|
|
marginTop: '28px'
|
|
|
|
},
|
|
|
|
'& .prejoin-dialog-dialin-btns > div': {
|
|
|
|
marginBottom: theme.spacing(3)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2020-05-14 12:30:24 +00:00
|
|
|
/**
|
2021-03-16 15:59:33 +00:00
|
|
|
* This component displays the dialog with all the information
|
2020-05-14 12:30:24 +00:00
|
|
|
* to join a meeting by calling it.
|
|
|
|
*
|
|
|
|
* @param {Props} props - The props of the component.
|
|
|
|
* @returns {React$Element}
|
|
|
|
*/
|
|
|
|
function DialinDialog(props: Props) {
|
|
|
|
const {
|
|
|
|
number,
|
|
|
|
onBack,
|
|
|
|
onPrimaryButtonClick,
|
|
|
|
onSmallTextClick,
|
|
|
|
onTextButtonClick,
|
|
|
|
passCode,
|
|
|
|
t
|
|
|
|
} = props;
|
2022-09-13 07:36:00 +00:00
|
|
|
const { classes } = useStyles();
|
2020-05-14 12:30:24 +00:00
|
|
|
const flagClassName = `prejoin-dialog-flag iti-flag ${getCountryCodeFromPhone(
|
2021-11-04 21:10:43 +00:00
|
|
|
number
|
2020-05-14 12:30:24 +00:00
|
|
|
)}`;
|
|
|
|
|
|
|
|
return (
|
2022-03-15 11:30:38 +00:00
|
|
|
<div className = { classes.dialInDialog }>
|
2020-05-14 12:30:24 +00:00
|
|
|
<div className = 'prejoin-dialog-dialin-header'>
|
|
|
|
<Icon
|
|
|
|
className = 'prejoin-dialog-icon prejoin-dialog-dialin-icon'
|
|
|
|
onClick = { onBack }
|
2021-06-10 12:48:44 +00:00
|
|
|
role = 'button'
|
2020-05-14 12:30:24 +00:00
|
|
|
size = { 24 }
|
|
|
|
src = { IconArrowLeft } />
|
|
|
|
<div className = 'prejoin-dialog-title'>
|
|
|
|
{t('prejoin.dialInMeeting')}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<Label number = { 1 }>{ t('prejoin.dialInPin') }</Label>
|
|
|
|
|
|
|
|
<div className = 'prejoin-dialog-dialin-num-container'>
|
|
|
|
<div className = 'prejoin-dialog-dialin-num'>
|
|
|
|
<div className = { flagClassName } />
|
|
|
|
<span>{number}</span>
|
|
|
|
</div>
|
|
|
|
<div className = 'prejoin-dialog-dialin-num'>{passCode}</div>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<span
|
|
|
|
className = 'prejoin-dialog-dialin-link'
|
|
|
|
onClick = { onSmallTextClick }>
|
|
|
|
{t('prejoin.viewAllNumbers')}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div className = 'prejoin-dialog-delimiter' />
|
|
|
|
<Label
|
|
|
|
className = 'prejoin-dialog-dialin-spaced-label'
|
|
|
|
number = { 2 }>
|
|
|
|
{t('prejoin.connectedWithAudioQ')}
|
|
|
|
</Label>
|
|
|
|
<div className = 'prejoin-dialog-dialin-btns'>
|
2022-10-13 10:42:39 +00:00
|
|
|
<Button
|
2020-05-14 12:30:24 +00:00
|
|
|
className = 'prejoin-dialog-btn'
|
2022-10-13 10:42:39 +00:00
|
|
|
fullWidth = { true }
|
|
|
|
labelKey = 'prejoin.joinMeeting'
|
2020-05-14 12:30:24 +00:00
|
|
|
onClick = { onPrimaryButtonClick }
|
2022-10-13 10:42:39 +00:00
|
|
|
type = 'primary' />
|
|
|
|
<Button
|
2020-05-14 12:30:24 +00:00
|
|
|
className = 'prejoin-dialog-btn'
|
2022-10-13 10:42:39 +00:00
|
|
|
fullWidth = { true }
|
|
|
|
labelKey = 'dialog.Cancel'
|
2020-05-14 12:30:24 +00:00
|
|
|
onClick = { onTextButtonClick }
|
2022-10-13 10:42:39 +00:00
|
|
|
type = 'tertiary' />
|
2020-05-14 12:30:24 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(DialinDialog);
|