2022-08-25 11:35:19 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2022-06-15 07:34:09 +00:00
|
|
|
import { makeStyles } from '@material-ui/styles';
|
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';
|
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';
|
|
|
|
import { IconClose } from '../../../base/icons/svg/index';
|
|
|
|
// @ts-ignore
|
2020-05-20 08:25:31 +00:00
|
|
|
import { ActionButton } from '../../../base/premeeting';
|
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.
|
|
|
|
*/
|
|
|
|
onClose: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Submit handler.
|
|
|
|
*/
|
|
|
|
onSubmit: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handler for text button.
|
|
|
|
*/
|
2022-08-25 11:35:19 +00:00
|
|
|
onTextButtonClick: Function
|
|
|
|
}
|
2020-05-14 12:30:24 +00:00
|
|
|
|
2022-08-25 11:35:19 +00:00
|
|
|
const useStyles = makeStyles((theme: any) => {
|
2022-06-15 07:34:09 +00:00
|
|
|
return {
|
|
|
|
dialOutDialog: {
|
|
|
|
padding: `${theme.spacing(3)}px`
|
|
|
|
},
|
|
|
|
header: {
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: 'space-between',
|
|
|
|
marginBottom: `${theme.spacing(4)}px`
|
|
|
|
},
|
|
|
|
picker: {
|
|
|
|
margin: `${theme.spacing(2)}px 0 ${theme.spacing(3)}px 0`
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
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-06-15 07:34:09 +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>
|
|
|
|
<ActionButton
|
|
|
|
className = 'prejoin-dialog-btn'
|
|
|
|
onClick = { onSubmit }
|
|
|
|
type = 'primary'>
|
|
|
|
{t('prejoin.callMe')}
|
|
|
|
</ActionButton>
|
|
|
|
<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'>
|
|
|
|
<ActionButton
|
|
|
|
className = 'prejoin-dialog-btn'
|
|
|
|
onClick = { onTextButtonClick }
|
|
|
|
type = 'text'>
|
|
|
|
{t('prejoin.iWantToDialIn')}
|
|
|
|
</ActionButton>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(DialOutDialog);
|