PageViewLayout.tsx 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import type { ReactNode } from 'react';
  2. import styles from './PageViewLayout.module.scss';
  3. type Props = {
  4. children?: ReactNode,
  5. headerContents?: ReactNode,
  6. sideContents?: ReactNode,
  7. footerContents?: ReactNode,
  8. }
  9. export const PageViewLayout = (props: Props): JSX.Element => {
  10. const {
  11. children, headerContents, sideContents, footerContents,
  12. } = props;
  13. return (
  14. <>
  15. <div id="main" className={`main page-view-layout ${styles['page-view-layout']}`}>
  16. <div id="content-main" className="content-main container-lg grw-container-convertible">
  17. { headerContents != null && (
  18. <header className="sticky-top mb-4">
  19. {headerContents}
  20. </header>
  21. ) }
  22. { sideContents != null
  23. ? (
  24. <div className="d-flex flex-column flex-column-reverse flex-lg-row">
  25. <div className="flex-grow-1 flex-basis-0 mw-0">
  26. {children}
  27. </div>
  28. <div className="grw-side-contents-container d-edit-none" data-vrt-blackout-side-contents>
  29. <div className="grw-side-contents-sticky-container">
  30. {sideContents}
  31. </div>
  32. </div>
  33. </div>
  34. )
  35. : (
  36. <>{children}</>
  37. )
  38. }
  39. </div>
  40. </div>
  41. { footerContents != null && (
  42. <footer className="footer d-edit-none">
  43. {footerContents}
  44. </footer>
  45. ) }
  46. </>
  47. );
  48. };