Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

DialOutDialog.js 3.0KB

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