Skip to content

Commit 105c9da

Browse files
committed
re-added PageBodyHeader
1 parent 456a9f3 commit 105c9da

File tree

2 files changed

+73
-1
lines changed

2 files changed

+73
-1
lines changed

library/src/layouting/PageLayout.tsx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,23 @@ const Page = ({
2222
)
2323

2424
const PageHeader = ({
25+
shadow = true,
2526
children,
2627
id,
2728
className,
2829
style,
2930
}: {
31+
shadow?: boolean
3032
children: React.ReactNode
3133
id?: string
3234
className?: string
3335
style?: React.CSSProperties
3436
}) => (
3537
<div
3638
className={twMerge(
37-
"border-border bg-neutral-subtle z-0 flex w-full flex-col border-b pl-5 pr-3 pt-5 shadow-md",
39+
`border-border bg-neutral-subtle z-0 flex w-full flex-col border-b pl-5 pr-3 pt-5 ${
40+
shadow ? "shadow-md" : ""
41+
}`,
3842
className,
3943
)}
4044
id={id}
@@ -146,6 +150,29 @@ const PageBodyContent = ({
146150
</div>
147151
)
148152

153+
const PageBodyHeader = ({
154+
children,
155+
id,
156+
className,
157+
style,
158+
}: {
159+
children: React.ReactNode
160+
id?: string
161+
className?: string
162+
style?: React.CSSProperties
163+
}) => (
164+
<div
165+
className={twMerge(
166+
"bg-neutral-subtle z-0 pb-2 pl-4 pr-3 pt-3 shadow-md",
167+
className,
168+
)}
169+
id={id}
170+
style={style}
171+
>
172+
{children}
173+
</div>
174+
)
175+
149176
const PageBodyFooter = ({
150177
children,
151178
id,
@@ -176,6 +203,7 @@ const PageLayout = {
176203
PageHeaderSubTitle,
177204
PageBody,
178205
PageBodyContent,
206+
PageBodyHeader,
179207
PageBodyFooter,
180208
PageHeaderLine,
181209
}

showcase/src/components/showcase/wrapper/PageLayoutShowcase.tsx

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,45 @@ function PageLayoutExample() {
4545
//#endregion pagelayout
4646
}
4747

48+
function PageLayoutExampleWithBodyHeader() {
49+
//#region pagelayoutwithbodyheader
50+
return (
51+
<div
52+
style={{
53+
height: "40vh",
54+
}}
55+
>
56+
<PageLayout.Page>
57+
<PageLayout.PageHeader shadow={false}>
58+
<PageLayout.PageHeaderTitle>
59+
<h1>Page Header Title</h1>
60+
</PageLayout.PageHeaderTitle>
61+
<PageLayout.PageHeaderSubTitle>
62+
<h2>Page Header Sub Title</h2>
63+
</PageLayout.PageHeaderSubTitle>
64+
<PageLayout.PageHeaderLine>
65+
<div>Page Header Line</div>
66+
<div>Page Header Line</div>
67+
<div>Page Header Line</div>
68+
</PageLayout.PageHeaderLine>
69+
</PageLayout.PageHeader>
70+
<PageLayout.PageBody>
71+
<PageLayout.PageBodyHeader>
72+
Body Header
73+
</PageLayout.PageBodyHeader>
74+
<PageLayout.PageBodyContent>
75+
Body Content
76+
</PageLayout.PageBodyContent>
77+
<PageLayout.PageBodyFooter>
78+
Page Body Footer
79+
</PageLayout.PageBodyFooter>
80+
</PageLayout.PageBody>
81+
</PageLayout.Page>
82+
</div>
83+
)
84+
//#endregion pagelayoutwithbodyheader
85+
}
86+
4887
export default function PageLayoutShowcase(props: ShowcaseProps) {
4988
return (
5089
<ShowcaseWrapperItem
@@ -62,6 +101,11 @@ export default function PageLayoutShowcase(props: ShowcaseProps) {
62101
example: <PageLayoutExample />,
63102
sourceCodeExampleId: "pagelayout",
64103
},
104+
{
105+
title: "Page Layout With Body Header",
106+
example: <PageLayoutExampleWithBodyHeader />,
107+
sourceCodeExampleId: "pagelayoutwithbodyheader",
108+
},
65109
]}
66110
/>
67111
)

0 commit comments

Comments
 (0)