fix: improve conditional Sidebar CSS

This commit is contained in:
Arvid Norlin
2024-05-28 14:32:54 +02:00
parent 49351e4565
commit 9d69f1fe58
2 changed files with 8 additions and 9 deletions

View File

@@ -8,12 +8,11 @@ import styles from "./loyaltyPage.module.css"
export default async function LoyaltyPage() {
const loyaltyPage = await serverClient().contentstack.loyaltyPage.get()
const hasSidebar = !!loyaltyPage.sidebar.length
return (
<section
className={`${styles.content} ${hasSidebar && styles.hasLeftSidebar}`}
>
{hasSidebar && <Sidebar blocks={loyaltyPage.sidebar} />}
<section className={styles.content}>
{loyaltyPage.sidebar.length ? (
<Sidebar blocks={loyaltyPage.sidebar} />
) : null}
<MaxWidth className={styles.blocks} tag="main">
{loyaltyPage.blocks ? <Blocks blocks={loyaltyPage.blocks} /> : null}

View File

@@ -13,10 +13,6 @@
}
@media screen and (min-width: 950px) {
.hasLeftSidebar {
grid-template-columns: 30rem 1fr;
}
.content {
gap: 2.7rem;
padding-bottom: 17.5rem;
@@ -25,6 +21,10 @@
padding-top: 5.8rem;
}
.content:has(> aside) {
grid-template-columns: 30rem 1fr;
}
.blocks {
gap: 6.4rem;
padding-left: 0;