2022-08-25 11:35:19 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
2022-03-15 11:16:01 +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-20 10:57:03 +00:00
|
|
|
|
2022-08-25 11:35:19 +00:00
|
|
|
// @ts-ignore
|
2020-05-14 12:30:24 +00:00
|
|
|
import { Avatar } from '../../../base/avatar';
|
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-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 phone number that is being called.
|
|
|
|
*/
|
|
|
|
number: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Closes the dialog.
|
|
|
|
*/
|
|
|
|
onClose: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handler used on hangup click.
|
|
|
|
*/
|
|
|
|
onHangup: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The status of the call.
|
|
|
|
*/
|
2022-08-25 11:35:19 +00:00
|
|
|
status: string
|
|
|
|
}
|
2020-05-14 12:30:24 +00:00
|
|
|
|
2022-08-25 11:35:19 +00:00
|
|
|
const useStyles = makeStyles((theme: any) => {
|
2022-03-15 11:16:01 +00:00
|
|
|
return {
|
|
|
|
callingDialog: {
|
|
|
|
padding: theme.spacing(3),
|
|
|
|
textAlign: 'center',
|
|
|
|
|
|
|
|
'& .prejoin-dialog-calling-header': {
|
|
|
|
textAlign: 'right'
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .prejoin-dialog-calling-label': {
|
|
|
|
fontSize: '15px',
|
|
|
|
margin: `${theme.spacing(2)}px 0 ${theme.spacing(3)}px 0`
|
|
|
|
},
|
|
|
|
|
|
|
|
'& .prejoin-dialog-calling-number': {
|
|
|
|
fontSize: '19px',
|
|
|
|
lineHeight: '28px',
|
|
|
|
margin: `${theme.spacing(3)}px 0`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2020-05-14 12:30:24 +00:00
|
|
|
/**
|
|
|
|
* Dialog displayed when the user gets called by the meeting.
|
|
|
|
*
|
|
|
|
* @param {Props} props - The props of the component.
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
function CallingDialog(props: Props) {
|
|
|
|
const { number, onClose, status, t } = props;
|
2022-03-15 11:16:01 +00:00
|
|
|
const classes = useStyles();
|
2020-05-14 12:30:24 +00:00
|
|
|
|
|
|
|
return (
|
2022-03-15 11:16:01 +00:00
|
|
|
<div className = { classes.callingDialog }>
|
2020-05-14 12:30:24 +00:00
|
|
|
<div className = 'prejoin-dialog-calling-header'>
|
|
|
|
<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 className = 'prejoin-dialog-calling-label'>
|
|
|
|
{t(status)}
|
|
|
|
</Label>
|
|
|
|
<Avatar size = { 72 } />
|
|
|
|
<div className = 'prejoin-dialog-calling-number'>{number}</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(CallingDialog);
|