Merge pull request #2103 from 0x346e3730/feat/full-width-main-if-no-sidebar

feat(templates): make main full-width if sidebar is empty
This commit is contained in:
Amruth Pillai
2025-01-12 15:31:42 +01:00
committed by GitHub
7 changed files with 10 additions and 10 deletions

View File

@ -566,7 +566,7 @@ export const Chikorita = ({ columns, isFirstPage = false }: TemplateProps) => {
return (
<div className="grid min-h-[inherit] grid-cols-3">
<div className="main p-custom group col-span-2 space-y-4">
<div className={cn("main p-custom group space-y-4", sidebar.length !== 0 ? "col-span-2" : "col-span-3")}>
{isFirstPage && <Header />}
{main.map((section) => (
@ -574,7 +574,7 @@ export const Chikorita = ({ columns, isFirstPage = false }: TemplateProps) => {
))}
</div>
<div className="sidebar p-custom group h-full space-y-4 bg-primary text-background">
<div className={cn("sidebar p-custom group h-full space-y-4 bg-primary text-background", sidebar.length === 0 && "hidden")}>
{sidebar.map((section) => (
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
))}