fix(SW-190): reverted changes in MaxWidth
This commit is contained in:
@@ -27,7 +27,7 @@ export default async function LoyaltyPage() {
|
|||||||
<Sidebar blocks={loyaltyPage.sidebar} />
|
<Sidebar blocks={loyaltyPage.sidebar} />
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<MaxWidth className={styles.blocks} variant="content" tag="main">
|
<MaxWidth className={styles.blocks}>
|
||||||
<header className={styles.header}>
|
<header className={styles.header}>
|
||||||
<Intro>
|
<Intro>
|
||||||
<Title as="h2">{loyaltyPage.heading}</Title>
|
<Title as="h2">{loyaltyPage.heading}</Title>
|
||||||
|
|||||||
@@ -1,20 +1,11 @@
|
|||||||
import { PropsWithChildren } from "react"
|
import { PropsWithChildren } from "react"
|
||||||
|
|
||||||
import MaxWidth from "@/components/MaxWidth"
|
|
||||||
|
|
||||||
import styles from "./intro.module.css"
|
import styles from "./intro.module.css"
|
||||||
|
|
||||||
export default async function Intro({ children }: PropsWithChildren) {
|
export default async function Intro({ children }: PropsWithChildren) {
|
||||||
return (
|
return (
|
||||||
<MaxWidth variant="content" tag="div">
|
<div className={styles.intro}>
|
||||||
<MaxWidth
|
<div className={styles.content}>{children}</div>
|
||||||
className={styles.content}
|
</div>
|
||||||
variant="text"
|
|
||||||
align="left"
|
|
||||||
tag="div"
|
|
||||||
>
|
|
||||||
{children}
|
|
||||||
</MaxWidth>
|
|
||||||
</MaxWidth>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
.intro {
|
||||||
|
max-width: 74.75rem;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--Spacing-x2);
|
gap: var(--Spacing-x2);
|
||||||
|
|||||||
@@ -1,21 +1,17 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
import { cva } from "class-variance-authority"
|
||||||
|
|
||||||
import { maxWidthVariants } from "./variants"
|
import styles from "./maxWidth.module.css"
|
||||||
|
|
||||||
import type { MaxWidthProps } from "@/types/components/max-width"
|
import type { MaxWidthProps } from "@/types/components/max-width"
|
||||||
|
|
||||||
|
const maxWidthVariants = cva(styles.container)
|
||||||
|
|
||||||
export default function MaxWidth({
|
export default function MaxWidth({
|
||||||
className,
|
className,
|
||||||
tag = "section",
|
tag = "section",
|
||||||
variant,
|
|
||||||
align,
|
|
||||||
...props
|
...props
|
||||||
}: MaxWidthProps) {
|
}: MaxWidthProps) {
|
||||||
const Cmp = tag
|
const Cmp = tag
|
||||||
return (
|
return <Cmp className={maxWidthVariants({ className })} {...props} />
|
||||||
<Cmp
|
|
||||||
className={maxWidthVariants({ className, variant, align })}
|
|
||||||
{...props}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +1,4 @@
|
|||||||
.container {
|
.container {
|
||||||
position: relative;
|
|
||||||
max-width: 100%;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container.default {
|
|
||||||
max-width: var(--max-width, 1140px);
|
max-width: var(--max-width, 1140px);
|
||||||
}
|
position: relative;
|
||||||
|
|
||||||
.container.text {
|
|
||||||
max-width: 49.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container.content {
|
|
||||||
max-width: 74.75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.container.center {
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
import { cva } from "class-variance-authority"
|
|
||||||
|
|
||||||
import styles from "./maxWidth.module.css"
|
|
||||||
|
|
||||||
export const maxWidthVariants = cva(styles.container, {
|
|
||||||
variants: {
|
|
||||||
variant: {
|
|
||||||
text: styles.text,
|
|
||||||
content: styles.content,
|
|
||||||
default: styles.default,
|
|
||||||
},
|
|
||||||
align: {
|
|
||||||
center: styles.center,
|
|
||||||
left: styles.left,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
defaultVariants: {
|
|
||||||
variant: "default",
|
|
||||||
align: "center",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
@@ -1,9 +1,3 @@
|
|||||||
import { VariantProps } from "class-variance-authority"
|
export interface MaxWidthProps extends React.HTMLAttributes<HTMLElement> {
|
||||||
|
|
||||||
import { maxWidthVariants } from "@/components/MaxWidth/variants"
|
|
||||||
|
|
||||||
export interface MaxWidthProps
|
|
||||||
extends React.HTMLAttributes<HTMLElement>,
|
|
||||||
VariantProps<typeof maxWidthVariants> {
|
|
||||||
tag?: "article" | "div" | "main" | "section"
|
tag?: "article" | "div" | "main" | "section"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user