fix: improve conditional Sidebar CSS
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user