Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

JitsiPortal.tsx 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React, { ReactNode } from 'react';
  2. import { makeStyles } from 'tss-react/mui';
  3. import DialogPortal from './DialogPortal';
  4. interface IProps {
  5. /**
  6. * The component(s) to be displayed within the drawer portal.
  7. */
  8. children: ReactNode;
  9. /**
  10. * Class name used to add custom styles to the portal.
  11. */
  12. className?: string;
  13. }
  14. const useStyles = makeStyles()(theme => {
  15. return {
  16. portal: {
  17. position: 'absolute',
  18. left: 0,
  19. right: 0,
  20. bottom: 0,
  21. zIndex: 351,
  22. borderRadius: '16px 16px 0 0',
  23. '&.notification-portal': {
  24. zIndex: 901
  25. },
  26. '&::after': {
  27. content: '""',
  28. backgroundColor: theme.palette.ui01,
  29. marginBottom: 'env(safe-area-inset-bottom, 0)'
  30. }
  31. }
  32. };
  33. });
  34. /**
  35. * Component meant to render a drawer at the bottom of the screen,
  36. * by creating a portal containing the component's children.
  37. *
  38. * @returns {ReactElement}
  39. */
  40. function JitsiPortal({ children, className }: IProps) {
  41. const { classes, cx } = useStyles();
  42. return (
  43. <DialogPortal className = { cx(classes.portal, className) }>
  44. { children }
  45. </DialogPortal>
  46. );
  47. }
  48. export default JitsiPortal;