PageViewLayout.tsx 1.5 KB

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