| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- import type { ReactNode } from 'react';
- import styles from './PageViewLayout.module.scss';
- const pageViewLayoutClass = styles['page-view-layout'] ?? '';
- const _fluidLayoutClass = styles['fluid-layout'] ?? '';
- type Props = {
- children?: ReactNode,
- headerContents?: ReactNode,
- sideContents?: ReactNode,
- footerContents?: ReactNode,
- expandContentWidth?: boolean,
- }
- export const PageViewLayout = (props: Props): JSX.Element => {
- const {
- children, headerContents, sideContents, footerContents,
- expandContentWidth,
- } = props;
- const fluidLayoutClass = expandContentWidth ? _fluidLayoutClass : '';
- return (
- <>
- <div className={`main ${pageViewLayoutClass} ${fluidLayoutClass} flex-expand-vert ps-sidebar`}>
- <div className="container-lg wide-gutter-x-lg grw-container-convertible flex-expand-vert">
- { headerContents != null && headerContents }
- { sideContents != null
- ? (
- <div className="flex-expand-horiz gap-3">
- <div className="flex-expand-vert flex-basis-0 mw-0">
- {children}
- </div>
- <div className="grw-side-contents-container col-lg-3 d-edit-none d-print-none" data-vrt-blackout-side-contents>
- <div className="grw-side-contents-sticky-container">
- {sideContents}
- </div>
- </div>
- </div>
- )
- : (
- <>{children}</>
- )
- }
- </div>
- </div>
- { footerContents != null && (
- <footer className={`footer d-edit-none wide-gutter-x-lg ${fluidLayoutClass}`}>
- {footerContents}
- </footer>
- ) }
- </>
- );
- };
|