2020-05-14 15:30:24 +03:00
|
|
|
import React from 'react';
|
2022-08-25 14:35:19 +03:00
|
|
|
import { WithTranslation } from 'react-i18next';
|
2022-09-13 10:36:00 +03:00
|
|
|
import { makeStyles } from 'tss-react/mui';
|
2020-05-14 15:30:24 +03:00
|
|
|
|
2022-10-28 12:07:58 +02:00
|
|
|
import { translate } from '../../../../base/i18n/functions';
|
|
|
|
|
import Icon from '../../../../base/icons/components/Icon';
|
2022-11-08 12:24:32 +02:00
|
|
|
import { IconCloseLarge } from '../../../../base/icons/svg';
|
2022-11-01 13:36:32 +01:00
|
|
|
import Button from '../../../../base/ui/components/web/Button';
|
2020-05-20 12:57:03 +02:00
|
|
|
import Label from '../Label';
|
2020-05-14 15:30:24 +03:00
|
|
|
import CountryPicker from '../country-picker/CountryPicker';
|
|
|
|
|
|
2022-10-20 12:11:27 +03:00
|
|
|
interface IProps extends WithTranslation {
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Closes a dialog.
|
|
|
|
|
*/
|
2022-09-08 12:52:36 +03:00
|
|
|
onClose: Function;
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Submit handler.
|
|
|
|
|
*/
|
2022-09-08 12:52:36 +03:00
|
|
|
onSubmit: Function;
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Handler for text button.
|
|
|
|
|
*/
|
2022-09-08 12:52:36 +03:00
|
|
|
onTextButtonClick: Function;
|
2022-08-25 14:35:19 +03:00
|
|
|
}
|
2020-05-14 15:30:24 +03:00
|
|
|
|
2022-11-15 08:50:22 +01:00
|
|
|
const useStyles = makeStyles()(theme => {
|
2022-06-15 12:04:09 +04:30
|
|
|
return {
|
|
|
|
|
dialOutDialog: {
|
2022-09-13 10:36:00 +03:00
|
|
|
padding: theme.spacing(3)
|
2022-06-15 12:04:09 +04:30
|
|
|
},
|
|
|
|
|
header: {
|
|
|
|
|
display: 'flex',
|
|
|
|
|
justifyContent: 'space-between',
|
2022-09-13 10:36:00 +03:00
|
|
|
marginBottom: theme.spacing(4)
|
2022-06-15 12:04:09 +04:30
|
|
|
},
|
|
|
|
|
picker: {
|
2022-09-13 10:36:00 +03:00
|
|
|
margin: `${theme.spacing(2)} 0 ${theme.spacing(3)} 0`
|
2022-06-15 12:04:09 +04:30
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
2020-05-14 15:30:24 +03:00
|
|
|
/**
|
2021-03-16 11:59:33 -04:00
|
|
|
* This component displays the dialog from which the user can enter the
|
2020-05-14 15:30:24 +03:00
|
|
|
* phone number in order to be called by the meeting.
|
|
|
|
|
*
|
2022-10-20 12:11:27 +03:00
|
|
|
* @param {IProps} props - The props of the component.
|
2020-05-14 15:30:24 +03:00
|
|
|
* @returns {React$Element}
|
|
|
|
|
*/
|
2022-10-20 12:11:27 +03:00
|
|
|
function DialOutDialog(props: IProps) {
|
2020-05-14 15:30:24 +03:00
|
|
|
const { onClose, onTextButtonClick, onSubmit, t } = props;
|
2022-09-13 10:36:00 +03:00
|
|
|
const { classes } = useStyles();
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
return (
|
2022-06-15 12:04:09 +04:30
|
|
|
<div className = { classes.dialOutDialog }>
|
|
|
|
|
<div className = { classes.header }>
|
2020-05-14 15:30:24 +03:00
|
|
|
<div className = 'prejoin-dialog-title'>
|
|
|
|
|
{t('prejoin.startWithPhone')}
|
|
|
|
|
</div>
|
|
|
|
|
<Icon
|
|
|
|
|
className = 'prejoin-dialog-icon'
|
|
|
|
|
onClick = { onClose }
|
2021-06-10 14:48:44 +02:00
|
|
|
role = 'button'
|
2020-05-14 15:30:24 +03:00
|
|
|
size = { 24 }
|
2022-11-08 12:24:32 +02:00
|
|
|
src = { IconCloseLarge } />
|
2020-05-14 15:30:24 +03:00
|
|
|
</div>
|
|
|
|
|
<Label>{t('prejoin.callMeAtNumber')}</Label>
|
2022-06-15 12:04:09 +04:30
|
|
|
<div className = { classes.picker }>
|
2020-05-14 15:30:24 +03:00
|
|
|
<CountryPicker onSubmit = { onSubmit } />
|
|
|
|
|
</div>
|
2022-10-13 13:42:39 +03:00
|
|
|
<Button
|
2020-05-14 15:30:24 +03:00
|
|
|
className = 'prejoin-dialog-btn'
|
2022-10-13 13:42:39 +03:00
|
|
|
fullWidth = { true }
|
|
|
|
|
labelKey = 'prejoin.callMe'
|
2020-05-14 15:30:24 +03:00
|
|
|
onClick = { onSubmit }
|
2022-10-13 13:42:39 +03:00
|
|
|
type = 'primary' />
|
2020-05-14 15:30:24 +03: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 13:42:39 +03:00
|
|
|
<Button
|
2020-05-14 15:30:24 +03:00
|
|
|
className = 'prejoin-dialog-btn'
|
2022-10-13 13:42:39 +03:00
|
|
|
fullWidth = { true }
|
|
|
|
|
labelKey = 'prejoin.iWantToDialIn'
|
2020-05-14 15:30:24 +03:00
|
|
|
onClick = { onTextButtonClick }
|
2022-10-13 13:42:39 +03:00
|
|
|
type = 'tertiary' />
|
2020-05-14 15:30:24 +03:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default translate(DialOutDialog);
|