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-20 12:57:03 +02:00
|
|
|
|
2023-03-23 10:26:19 +02:00
|
|
|
import Avatar from '../../../../base/avatar/components/Avatar';
|
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';
|
2020-05-14 15:30:24 +03:00
|
|
|
import Label from '../Label';
|
|
|
|
|
|
2022-10-20 12:11:27 +03:00
|
|
|
interface IProps extends WithTranslation {
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The phone number that is being called.
|
|
|
|
|
*/
|
2022-09-08 12:52:36 +03:00
|
|
|
number: string;
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Closes the dialog.
|
|
|
|
|
*/
|
2022-09-08 12:52:36 +03:00
|
|
|
onClose: Function;
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Handler used on hangup click.
|
|
|
|
|
*/
|
2022-09-08 12:52:36 +03:00
|
|
|
onHangup: Function;
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The status of the call.
|
|
|
|
|
*/
|
2022-09-08 12:52:36 +03:00
|
|
|
status: string;
|
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-03-15 14:46:01 +03:30
|
|
|
return {
|
|
|
|
|
callingDialog: {
|
|
|
|
|
padding: theme.spacing(3),
|
|
|
|
|
textAlign: 'center',
|
|
|
|
|
|
|
|
|
|
'& .prejoin-dialog-calling-header': {
|
|
|
|
|
textAlign: 'right'
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
'& .prejoin-dialog-calling-label': {
|
|
|
|
|
fontSize: '15px',
|
2022-09-13 10:36:00 +03:00
|
|
|
margin: `${theme.spacing(2)} 0 ${theme.spacing(3)} 0`
|
2022-03-15 14:46:01 +03:30
|
|
|
},
|
|
|
|
|
|
|
|
|
|
'& .prejoin-dialog-calling-number': {
|
|
|
|
|
fontSize: '19px',
|
|
|
|
|
lineHeight: '28px',
|
2022-09-13 10:36:00 +03:00
|
|
|
margin: `${theme.spacing(3)} 0`
|
2022-03-15 14:46:01 +03:30
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
|
2020-05-14 15:30:24 +03:00
|
|
|
/**
|
|
|
|
|
* Dialog displayed when the user gets 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 {ReactElement}
|
|
|
|
|
*/
|
2022-10-20 12:11:27 +03:00
|
|
|
function CallingDialog(props: IProps) {
|
2020-05-14 15:30:24 +03:00
|
|
|
const { number, onClose, status, t } = props;
|
2022-09-13 10:36:00 +03:00
|
|
|
const { classes } = useStyles();
|
2020-05-14 15:30:24 +03:00
|
|
|
|
|
|
|
|
return (
|
2022-03-15 14:46:01 +03:30
|
|
|
<div className = { classes.callingDialog }>
|
2020-05-14 15:30:24 +03:00
|
|
|
<div className = 'prejoin-dialog-calling-header'>
|
|
|
|
|
<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 className = 'prejoin-dialog-calling-label'>
|
|
|
|
|
{t(status)}
|
|
|
|
|
</Label>
|
|
|
|
|
<Avatar size = { 72 } />
|
|
|
|
|
<div className = 'prejoin-dialog-calling-number'>{number}</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default translate(CallingDialog);
|