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

ScreenSharePlaceholder.web.tsx 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. import { Theme } from '@mui/material';
  2. import React, { useCallback } from 'react';
  3. import { WithTranslation } from 'react-i18next';
  4. import { useStore } from 'react-redux';
  5. import { makeStyles } from 'tss-react/mui';
  6. import { translate } from '../../base/i18n/functions';
  7. // eslint-disable-next-line lines-around-comment
  8. // @ts-ignore
  9. import { setSeeWhatIsBeingShared } from '../actions.web';
  10. const useStyles = makeStyles()((theme: Theme) => {
  11. return {
  12. overlayContainer: {
  13. width: '100%',
  14. height: '100%',
  15. backgroundColor: theme.palette.ui02,
  16. display: 'flex',
  17. justifyContent: 'center',
  18. alignItems: 'center',
  19. position: 'absolute'
  20. },
  21. content: {
  22. display: 'flex',
  23. flexDirection: 'column',
  24. alignItems: 'center',
  25. justifyContent: 'center'
  26. },
  27. laptop: {
  28. width: '88px',
  29. height: '56px',
  30. boxSizing: 'border-box',
  31. border: '3px solid',
  32. borderColor: theme.palette.text01,
  33. borderRadius: '6px'
  34. },
  35. laptopStand: {
  36. width: '40px',
  37. height: '4px',
  38. backgroundColor: theme.palette.text01,
  39. boxSizing: 'border-box',
  40. borderRadius: '6px',
  41. marginTop: '4px'
  42. },
  43. sharingMessage: {
  44. fontStyle: 'normal',
  45. fontWeight: 600,
  46. fontSize: '20px',
  47. lineHeight: '28px',
  48. marginTop: '24px',
  49. letterSpacing: '-0.012em',
  50. color: theme.palette.text01
  51. },
  52. showSharing: {
  53. fontStyle: 'normal',
  54. fontWeight: 600,
  55. fontSize: '14px',
  56. lineHeight: '20px',
  57. height: '20px',
  58. marginTop: '16px',
  59. color: theme.palette.link01,
  60. cursor: 'pointer',
  61. '&:hover': {
  62. color: theme.palette.link01Hover
  63. }
  64. }
  65. };
  66. });
  67. /**
  68. * Component that displays a placeholder for when the screen is shared.
  69. * * @param {Function} t - Function which translate strings.
  70. *
  71. * @returns {ReactElement}
  72. */
  73. const ScreenSharePlaceholder: React.FC<WithTranslation> = ({ t }) => {
  74. const { classes } = useStyles();
  75. const store = useStore();
  76. const updateShowMeWhatImSharing = useCallback(() => {
  77. store.dispatch(setSeeWhatIsBeingShared(true));
  78. }, []);
  79. return (
  80. <div className = { classes.overlayContainer }>
  81. <div className = { classes.content }>
  82. <div className = { classes.laptop } />
  83. <div className = { classes.laptopStand } />
  84. <span className = { classes.sharingMessage }>{ t('largeVideo.screenIsShared') }</span>
  85. <span
  86. className = { classes.showSharing }
  87. onClick = { updateShowMeWhatImSharing }
  88. role = 'button'>{ t('largeVideo.showMeWhatImSharing') }</span>
  89. </div>
  90. </div>
  91. );
  92. };
  93. export default translate(ScreenSharePlaceholder);