Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ScreenSharePlaceholder.web.tsx 2.8KB

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