plane/apps/app/layouts/app-layout.tsx

44 lines
1.2 KiB
TypeScript
Raw Normal View History

import React, { useState } from "react";
2022-11-19 14:21:26 +00:00
// layouts
import Container from "layouts/container";
2022-12-16 20:05:19 +00:00
import Sidebar from "layouts/navbar/main-siderbar";
import Header from "layouts/navbar/header";
// components
import CreateProjectModal from "components/project/create-project-modal";
2022-11-19 14:21:26 +00:00
// types
import type { Props } from "./types";
const AppLayout: React.FC<Props> = ({
meta,
children,
noPadding = false,
bg = "primary",
2022-12-15 04:17:56 +00:00
noHeader = false,
breadcrumbs,
2022-12-15 04:17:56 +00:00
left,
right,
}) => {
const [isOpen, setIsOpen] = useState(false);
2022-11-19 14:21:26 +00:00
return (
<Container meta={meta}>
<CreateProjectModal isOpen={isOpen} setIsOpen={setIsOpen} />
<div className="h-screen w-full flex overflow-x-hidden">
<Sidebar />
<main className="h-screen w-full flex flex-col overflow-y-auto min-w-0">
2022-12-15 04:17:56 +00:00
{noHeader ? null : <Header breadcrumbs={breadcrumbs} left={left} right={right} />}
<div
className={`w-full flex-grow ${noPadding ? "" : "p-5"} ${
bg === "primary" ? "bg-primary" : bg === "secondary" ? "bg-secondary" : "bg-primary"
}`}
>
{children}
</div>
</main>
2022-11-19 14:21:26 +00:00
</div>
</Container>
);
};
export default AppLayout;