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.

ScreenSharePlaceholder.web.tsx 2.9KB

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