refactor Layout component to remove contentLayout prop and simplify class assignment
This commit is contained in:
parent
80633f89aa
commit
0511d90911
2 changed files with 2 additions and 5 deletions
|
|
@ -6,11 +6,9 @@ import Header from "../components/Header.astro";
|
|||
interface Props {
|
||||
title: string;
|
||||
description: string;
|
||||
contentLayout?: "default" | "fill-height";
|
||||
}
|
||||
|
||||
const { title, description, contentLayout = "default" } = Astro.props;
|
||||
const contentClass = contentLayout === "fill-height" ? "flex-1" : "py-12";
|
||||
const { title, description } = Astro.props;
|
||||
---
|
||||
|
||||
<!doctype html>
|
||||
|
|
@ -25,7 +23,7 @@ const contentClass = contentLayout === "fill-height" ? "flex-1" : "py-12";
|
|||
</head>
|
||||
<body class="h-screen max-w-5xl mx-auto flex flex-col font-sans">
|
||||
<Header />
|
||||
<div class={`w-full max-w-3xl mx-auto ${contentClass}`}>
|
||||
<div class="w-full max-w-3xl mx-auto flex-1 py-12">
|
||||
<slot />
|
||||
</div>
|
||||
<Footer />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue