Skip to content

Commit 1bb2bde

Browse files
committed
refactor: Dynamically adjust component grid layouts and consolidate import statements.
1 parent f4b39c3 commit 1bb2bde

File tree

6 files changed

+993
-819
lines changed

6 files changed

+993
-819
lines changed

src/components/CTABanner.jsx

Lines changed: 59 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,68 @@
1-
import { Paper, Stack, Text, Box } from "@mantine/core";
2-
import { Layout } from "./Layout.jsx";
3-
import { CTAButton } from "../primitives/CTAButton.jsx";
1+
import { Paper, Stack, Text, Box } from '@mantine/core'
2+
import { Layout } from './Layout.jsx'
3+
import { resolveBackground } from '../configs/backgrounds.js'
4+
import { CTAButton } from '../primitives/CTAButton.jsx'
45

56
/**
67
* CTABanner - A large CTA section with a highlighted box.
78
* (Previously: SecondaryCTA)
89
*/
9-
export function CTABanner({
10-
id,
11-
title,
12-
description,
13-
cta,
14-
background = "gray.0",
15-
}) {
16-
return (
17-
<Layout id={id} background={background} ta="center">
18-
<Paper
19-
p={{ base: "xl", sm: 80 }}
20-
bg="white"
21-
radius="0"
22-
bd="1px solid var(--mantine-color-gray-2)"
23-
style={{ borderTop: "4px solid var(--mantine-color-gray-9)" }}
24-
>
25-
<Stack align="center" ta="center" gap="xl">
26-
{title && (
27-
<Text
28-
fz="var(--fz-section-title)"
29-
fw={900}
30-
lh={1.2}
31-
ls="-0.04em"
32-
maw={700}
10+
export function CTABanner({ id, title, description, cta, background = 'gray' }) {
11+
return (
12+
<Layout
13+
id={id}
14+
background={background}
15+
ta="center"
16+
>
17+
<Paper
18+
p={{ base: 'xl', sm: 80 }}
19+
bg={resolveBackground('white')}
20+
radius="0"
21+
bd="1px solid var(--mantine-color-gray-2)"
22+
style={{ borderTop: '4px solid var(--mantine-color-gray-9)' }}
3323
>
34-
{title}
35-
</Text>
36-
)}
37-
{description && (
38-
<Text c="gray.7" size="xl" maw={550}>
39-
{description}
40-
</Text>
41-
)}
42-
{cta && (
43-
<Box mt="md">
44-
<CTAButton
45-
label={cta.label}
46-
href={cta.href}
47-
size={cta.size || "xl"}
48-
px={cta.px || { base: 32, md: 60 }}
49-
variant={cta.variant}
50-
color={cta.color}
51-
/>
52-
</Box>
53-
)}
54-
</Stack>
55-
</Paper>
56-
</Layout>
57-
);
24+
<Stack
25+
align="center"
26+
ta="center"
27+
gap="xl"
28+
>
29+
{title && (
30+
<Text
31+
fz="var(--fz-section-title)"
32+
fw={900}
33+
lh={1.2}
34+
ls="-0.04em"
35+
maw={700}
36+
>
37+
{title}
38+
</Text>
39+
)}
40+
{description && (
41+
<Text
42+
c="gray.7"
43+
size="xl"
44+
maw={550}
45+
>
46+
{description}
47+
</Text>
48+
)}
49+
{cta && (
50+
<Box mt="md">
51+
<CTAButton
52+
label={cta.label}
53+
href={cta.href}
54+
size={cta.size || 'xl'}
55+
px={cta.px || { base: 32, md: 60 }}
56+
variant={cta.variant}
57+
color={cta.color}
58+
/>
59+
</Box>
60+
)}
61+
</Stack>
62+
</Paper>
63+
</Layout>
64+
)
5865
}
5966

6067
/** @deprecated Use CTABanner instead */
61-
export const SecondaryCTA = CTABanner;
68+
export const SecondaryCTA = CTABanner

0 commit comments

Comments
 (0)