You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DialOutDialog.tsx 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* eslint-disable lines-around-comment */
  2. import { Theme } from '@mui/material';
  3. import React from 'react';
  4. import { WithTranslation } from 'react-i18next';
  5. import { makeStyles } from 'tss-react/mui';
  6. import { translate } from '../../../base/i18n/functions';
  7. import Icon from '../../../base/icons/components/Icon';
  8. import { IconClose } from '../../../base/icons/svg';
  9. // @ts-ignore
  10. import { ActionButton } from '../../../base/premeeting';
  11. // @ts-ignore
  12. import Label from '../Label';
  13. // @ts-ignore
  14. import CountryPicker from '../country-picker/CountryPicker';
  15. interface Props extends WithTranslation {
  16. /**
  17. * Closes a dialog.
  18. */
  19. onClose: Function;
  20. /**
  21. * Submit handler.
  22. */
  23. onSubmit: Function;
  24. /**
  25. * Handler for text button.
  26. */
  27. onTextButtonClick: Function;
  28. }
  29. const useStyles = makeStyles()((theme: Theme) => {
  30. return {
  31. dialOutDialog: {
  32. padding: theme.spacing(3)
  33. },
  34. header: {
  35. display: 'flex',
  36. justifyContent: 'space-between',
  37. marginBottom: theme.spacing(4)
  38. },
  39. picker: {
  40. margin: `${theme.spacing(2)} 0 ${theme.spacing(3)} 0`
  41. }
  42. };
  43. });
  44. /**
  45. * This component displays the dialog from which the user can enter the
  46. * phone number in order to be called by the meeting.
  47. *
  48. * @param {Props} props - The props of the component.
  49. * @returns {React$Element}
  50. */
  51. function DialOutDialog(props: Props) {
  52. const { onClose, onTextButtonClick, onSubmit, t } = props;
  53. const { classes } = useStyles();
  54. return (
  55. <div className = { classes.dialOutDialog }>
  56. <div className = { classes.header }>
  57. <div className = 'prejoin-dialog-title'>
  58. {t('prejoin.startWithPhone')}
  59. </div>
  60. <Icon
  61. className = 'prejoin-dialog-icon'
  62. onClick = { onClose }
  63. role = 'button'
  64. size = { 24 }
  65. src = { IconClose } />
  66. </div>
  67. <Label>{t('prejoin.callMeAtNumber')}</Label>
  68. <div className = { classes.picker }>
  69. <CountryPicker onSubmit = { onSubmit } />
  70. </div>
  71. <ActionButton
  72. className = 'prejoin-dialog-btn'
  73. onClick = { onSubmit }
  74. type = 'primary'>
  75. {t('prejoin.callMe')}
  76. </ActionButton>
  77. <div className = 'prejoin-dialog-delimiter-container'>
  78. <div className = 'prejoin-dialog-delimiter' />
  79. <div className = 'prejoin-dialog-delimiter-txt-container'>
  80. <span className = 'prejoin-dialog-delimiter-txt'>
  81. {t('prejoin.or')}
  82. </span>
  83. </div>
  84. </div>
  85. <div className = 'prejoin-dialog-dialin-container'>
  86. <ActionButton
  87. className = 'prejoin-dialog-btn'
  88. onClick = { onTextButtonClick }
  89. type = 'text'>
  90. {t('prejoin.iWantToDialIn')}
  91. </ActionButton>
  92. </div>
  93. </div>
  94. );
  95. }
  96. export default translate(DialOutDialog);