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-14 12:30:24 +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 { IconClose } 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-20 10:57:03 +00:00
|
|
|
import Label from '../Label';
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2020-05-14 12:30:24 +00:00
|
|
|
import CountryPicker from '../country-picker/CountryPicker';
|
|
|
|
|
2022-08-25 11:35:19 +00:00
|
|
|
interface Props extends WithTranslation {
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Closes a dialog.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
onClose: Function;
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Submit handler.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
onSubmit: Function;
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Handler for text button.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
onTextButtonClick: Function;
|
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-06-15 07:34:09 +00:00
|
|
|
return {
|
|
|
|
dialOutDialog: {
|
2022-09-13 07:36:00 +00:00
|
|
|
padding: theme.spacing(3)
|
2022-06-15 07:34:09 +00:00
|
|
|
},
|
|
|
|
header: {
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: 'space-between',
|
2022-09-13 07:36:00 +00:00
|
|
|
marginBottom: theme.spacing(4)
|
2022-06-15 07:34:09 +00:00
|
|
|
},
|
|
|
|
picker: {
|
2022-09-13 07:36:00 +00:00
|
|
|
margin: `${theme.spacing(2)} 0 ${theme.spacing(3)} 0`
|
2022-06-15 07:34:09 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2020-05-14 12:30:24 +00:00
|
|
|
/**
|
2021-03-16 15:59:33 +00:00
|
|
|
* This component displays the dialog from which the user can enter the
|
2020-05-14 12:30:24 +00:00
|
|
|
* phone number in order to be called by the meeting.
|
|
|
|
*
|
|
|
|
* @param {Props} props - The props of the component.
|
|
|
|
* @returns {React$Element}
|
|
|
|
*/
|
|
|
|
function DialOutDialog(props: Props) {
|
|
|
|
const { onClose, onTextButtonClick, onSubmit, t } = props;
|
2022-09-13 07:36:00 +00:00
|
|
|
const { classes } = useStyles();
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
return (
|
2022-06-15 07:34:09 +00:00
|
|
|
<div className = { classes.dialOutDialog }>
|
|
|
|
<div className = { classes.header }>
|
2020-05-14 12:30:24 +00:00
|
|
|
<div className = 'prejoin-dialog-title'>
|
|
|
|
{t('prejoin.startWithPhone')}
|
|
|
|
</div>
|
|
|
|
<Icon
|
|
|
|
className = 'prejoin-dialog-icon'
|
|
|
|
onClick = { onClose }
|
2021-06-10 12:48:44 +00:00
|
|
|
role = 'button'
|
2020-05-14 12:30:24 +00:00
|
|
|
size = { 24 }
|
|
|
|
src = { IconClose } />
|
|
|
|
</div>
|
|
|
|
<Label>{t('prejoin.callMeAtNumber')}</Label>
|
2022-06-15 07:34:09 +00:00
|
|
|
<div className = { classes.picker }>
|
2020-05-14 12:30:24 +00:00
|
|
|
<CountryPicker onSubmit = { onSubmit } />
|
|
|
|
</div>
|
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.callMe'
|
2020-05-14 12:30:24 +00:00
|
|
|
onClick = { onSubmit }
|
2022-10-13 10:42:39 +00:00
|
|
|
type = 'primary' />
|
2020-05-14 12:30:24 +00:00
|
|
|
<div className = 'prejoin-dialog-delimiter-container'>
|
|
|
|
<div className = 'prejoin-dialog-delimiter' />
|
|
|
|
<div className = 'prejoin-dialog-delimiter-txt-container'>
|
|
|
|
<span className = 'prejoin-dialog-delimiter-txt'>
|
|
|
|
{t('prejoin.or')}
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className = 'prejoin-dialog-dialin-container'>
|
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.iWantToDialIn'
|
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(DialOutDialog);
|