diff --git a/apps/react/src/app/components/page-layout/index.ts b/apps/react/src/app/components/page-layout/index.ts new file mode 100644 index 000000000..6e828525f --- /dev/null +++ b/apps/react/src/app/components/page-layout/index.ts @@ -0,0 +1,2 @@ +export { PageLayout } from './page-layout' +export type { PageLayoutProps } from './page-layout' diff --git a/apps/react/src/app/components/page-layout/page-layout.scss b/apps/react/src/app/components/page-layout/page-layout.scss new file mode 100644 index 000000000..3f7773207 --- /dev/null +++ b/apps/react/src/app/components/page-layout/page-layout.scss @@ -0,0 +1,45 @@ +.page-layout { + display: grid; + grid-template-columns: 300px 1fr; + gap: 20px; + min-height: calc(100vh - 60px); + padding: 20px; + + @media (max-width: 768px) { + grid-template-columns: 1fr; + gap: 10px; + padding: 10px; + } +} + +.page-layout__left { + flex-direction: column; +} + +.page-layout__right { + display: flex; + flex-direction: column; +} + +.page-layout__header { + margin-bottom: 20px; +} + +.page-layout__title { + margin-bottom: 20px; + font-size: 24px; + font-weight: 600; +} + +.page-layout__sticky { + position: sticky; + top: 0; + background: white; + z-index: 10; + padding: 10px 0; + margin-bottom: 20px; +} + +.page-layout__content { + flex: 1; +} diff --git a/apps/react/src/app/components/page-layout/page-layout.tsx b/apps/react/src/app/components/page-layout/page-layout.tsx new file mode 100644 index 000000000..1ce93f305 --- /dev/null +++ b/apps/react/src/app/components/page-layout/page-layout.tsx @@ -0,0 +1,36 @@ +import React from 'react' +import './page-layout.scss' + +export interface PageLayoutProps { + headerLeft?: React.ReactNode + title?: React.ReactNode + contentLeft?: React.ReactNode + stickyContent?: React.ReactNode + children: React.ReactNode + className?: string +} + +export const PageLayout: React.FC = ({ + headerLeft, + title, + contentLeft, + stickyContent, + children, + className, +}) => { + return ( +
+
+ {contentLeft} +
+
+ {headerLeft &&
{headerLeft}
} + {title &&
{title}
} + {stickyContent &&
{stickyContent}
} +
+ {children} +
+
+
+ ) +}