-
Notifications
You must be signed in to change notification settings - Fork 122
/
PageLayout.tsx
51 lines (48 loc) · 1.31 KB
/
PageLayout.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { Layout, PageHeader, PageHeaderProps } from "antd";
import React from "react";
import SlideOver from "../SlideOver/SlideOver";
import Heading from "./Heading/Heading";
interface PageLayoutProps extends PageHeaderProps {
hasBackButton?: boolean;
backButton?: React.ReactNode;
aboveTitle?: boolean;
mx?: boolean;
}
export function PageLayout({
children,
hasBackButton,
backButton,
mx = true,
aboveTitle = true,
...props
}: PageLayoutProps) {
return (
<div>
<SlideOver />
<Heading
hasBackButton={hasBackButton}
aboveTitle={aboveTitle}
backButton={backButton}
/>
<PageHeader className="!-mt-[26px]" />
<div className="mx-10 mt-16 pb-20">
<div className="flex items-center justify-between mb-6">
{props.title ? (
<h1
className={hasBackButton && mx ? "font-main mx-10" : "font-main"}
>
{hasBackButton && aboveTitle && backButton}
<div className={hasBackButton ? "mt-12" : ""}>{props.title}</div>
</h1>
) : (
<h1>{props.title}</h1>
)}
<div>{props.extra}</div>
</div>
<Layout.Content className="min-h-[calc(100vh-210px)]">
{children}
</Layout.Content>
</div>
</div>
);
}