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

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