Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(templates): make main full-width if sidebar is empty #2103

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/azurill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ export const Azurill = ({ columns, isFirstPage = false }: TemplateProps) => {
))}
</div>

<div className="main group col-span-2 space-y-4">
<div className={cn("main group space-y-4", sidebar.length !== 0 ? "col-span-2" : "col-span-3")}>
{main.map((section) => (
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
))}
Expand Down
4 changes: 2 additions & 2 deletions apps/artboard/src/templates/chikorita.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -578,15 +578,15 @@ 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) => (
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
))}
</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>
))}
Expand Down
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/ditto.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ export const Ditto = ({ columns, isFirstPage = false }: TemplateProps) => {
))}
</div>

<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")}>
{main.map((section) => (
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
))}
Expand Down
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/gengar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ export const Gengar = ({ columns, isFirstPage = false }: TemplateProps) => {
</div>
</div>

<div className="main group col-span-2">
<div className={cn("main group", sidebar.length !== 0 ? "col-span-2" : "col-span-3")}>
{isFirstPage && (
<div
className="p-custom space-y-4"
Expand Down
4 changes: 2 additions & 2 deletions apps/artboard/src/templates/glalie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ export const Glalie = ({ columns, isFirstPage = false }: TemplateProps) => {
return (
<div className="grid min-h-[inherit] grid-cols-3">
<div
className="sidebar p-custom group space-y-4"
className={cn("sidebar p-custom group space-y-4", sidebar.length === 0 && "hidden")}
style={{ backgroundColor: hexToRgb(primaryColor, 0.2) }}
>
{isFirstPage && <Header />}
Expand All @@ -601,7 +601,7 @@ export const Glalie = ({ columns, isFirstPage = false }: TemplateProps) => {
))}
</div>

<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")}>
{main.map((section) => (
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
))}
Expand Down
4 changes: 2 additions & 2 deletions apps/artboard/src/templates/leafish.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -527,13 +527,13 @@ export const Leafish = ({ columns, isFirstPage = false }: TemplateProps) => {
{isFirstPage && <Header />}

<div className="p-custom grid grid-cols-2 items-start space-x-6">
<div className="grid gap-y-4">
<div className={cn("grid gap-y-4", sidebar.length === 0 && "col-span-2")}>
{main.map((section) => (
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
))}
</div>

<div className="grid gap-y-4">
<div className={cn("grid gap-y-4", sidebar.length === 0 && "hidden")}>
{sidebar.map((section) => (
<Fragment key={section}>{mapSectionToComponent(section)}</Fragment>
))}
Expand Down
2 changes: 1 addition & 1 deletion apps/artboard/src/templates/pikachu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ export const Pikachu = ({ columns, isFirstPage = false }: TemplateProps) => {
))}
</div>

<div className="main group col-span-2 space-y-4">
<div className={cn("main group space-y-4", sidebar.length !== 0 ? "col-span-2" : "col-span-3")}>
{isFirstPage && <Header />}

{main.map((section) => (
Expand Down