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.1KB

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