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.

VisitorsQueue.tsx 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import React from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import { makeStyles } from 'tss-react/mui';
  4. import { withPixelLineHeight } from '../../../base/styles/functions';
  5. import LoadingIndicator from '../../../base/ui/components/web/Spinner';
  6. const useStyles = makeStyles()(theme => {
  7. return {
  8. container: {
  9. height: '100%',
  10. position: 'absolute',
  11. inset: '0 0 0 0',
  12. display: 'flex',
  13. backgroundColor: theme.palette.ui01,
  14. zIndex: 252,
  15. '@media (max-width: 720px)': {
  16. flexDirection: 'column-reverse'
  17. }
  18. },
  19. content: {
  20. display: 'flex',
  21. flexDirection: 'column',
  22. alignItems: 'center',
  23. flexShrink: 0,
  24. boxSizing: 'border-box',
  25. position: 'relative',
  26. width: '100%',
  27. height: '100%',
  28. zIndex: 252,
  29. '@media (max-width: 720px)': {
  30. height: 'auto',
  31. margin: '0 auto'
  32. },
  33. // mobile phone landscape
  34. '@media (max-width: 420px)': {
  35. padding: '16px 16px 0 16px',
  36. width: '100%'
  37. },
  38. '@media (max-width: 400px)': {
  39. padding: '16px'
  40. }
  41. },
  42. contentControls: {
  43. display: 'flex',
  44. flexDirection: 'column',
  45. alignItems: 'center',
  46. margin: 'auto',
  47. width: '100%'
  48. },
  49. roomName: {
  50. ...withPixelLineHeight(theme.typography.heading5),
  51. color: theme.palette.text01,
  52. marginBottom: theme.spacing(4),
  53. overflow: 'hidden',
  54. textAlign: 'center',
  55. textOverflow: 'ellipsis',
  56. whiteSpace: 'nowrap',
  57. width: '100%'
  58. },
  59. spinner: {
  60. margin: '8px'
  61. }
  62. };
  63. });
  64. /**
  65. * The component that renders visitors queue UI.
  66. *
  67. * @returns {ReactElement}
  68. */
  69. export default function VisitorsQueue() {
  70. const { classes } = useStyles();
  71. const { t } = useTranslation();
  72. return (<div
  73. className = { classes.container }
  74. id = 'visitors-waiting-queue'>
  75. <div className = { classes.content }>
  76. <div className = { classes.contentControls }>
  77. <span className = { classes.roomName }>
  78. { t('visitors.waitingMessage') }
  79. </span>
  80. <div className = { classes.spinner }>
  81. <LoadingIndicator size = 'large' />
  82. </div>
  83. </div>
  84. </div>
  85. </div>);
  86. }