Skip to content

Commit 04f59c1

Browse files
committed
feat: introduce centralized background configuration and refactor components to use a standardized background prop.
1 parent 479810a commit 04f59c1

File tree

15 files changed

+100
-24
lines changed

15 files changed

+100
-24
lines changed

src/components/CTABanner.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ import { CTAButton } from "../primitives/CTAButton.jsx";
66
* CTABanner - A large CTA section with a highlighted box.
77
* (Previously: SecondaryCTA)
88
*/
9-
export function CTABanner({ id, title, description, cta, bg = "gray.0" }) {
9+
export function CTABanner({
10+
id,
11+
title,
12+
description,
13+
cta,
14+
background = "gray.0",
15+
}) {
1016
return (
11-
<Layout id={id} bg={bg} ta="center">
17+
<Layout id={id} background={background} ta="center">
1218
<Paper
1319
p={{ base: "xl", sm: 80 }}
1420
bg="white"

src/components/Comparison.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@ import { CTAButton } from "../primitives/CTAButton.jsx";
1818
/**
1919
* Comparison - Generic component for comparing a "Traditional Way" vs "Your Way"
2020
*/
21-
export function Comparison({ id, subtitle, title, traditionalCol, newCol }) {
21+
export function Comparison({
22+
id,
23+
subtitle,
24+
title,
25+
traditionalCol,
26+
newCol,
27+
background = "white",
28+
}) {
2229
return (
23-
<Layout id={id} subtitle={subtitle} title={title} bg="white">
30+
<Layout id={id} subtitle={subtitle} title={title} background={background}>
2431
<Paper
2532
radius="0"
2633
bd="1px solid var(--mantine-color-gray-2)"

src/components/FAQ.jsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ import { CTAButton } from "../primitives/CTAButton.jsx";
1313
/**
1414
* FAQ - Generic component for Frequently Asked Questions
1515
*/
16-
export function FAQ({ id, subtitle, title, questions = [], contactCard }) {
16+
export function FAQ({
17+
id,
18+
subtitle,
19+
title,
20+
questions = [],
21+
contactCard,
22+
background = "white",
23+
}) {
1724
const accordionStyles = {
1825
item: {
1926
backgroundColor: "white",
@@ -35,7 +42,7 @@ export function FAQ({ id, subtitle, title, questions = [], contactCard }) {
3542
};
3643

3744
return (
38-
<Layout id={id} subtitle={subtitle} title={title} bg="white">
45+
<Layout id={id} subtitle={subtitle} title={title} background={background}>
3946
<SimpleGrid cols={{ base: 1, md: 2 }} spacing="xl">
4047
<Accordion
4148
variant="separated"

src/components/FeatureSplit.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function FeatureSplit({
2121
video,
2222
image,
2323
reverse = false,
24-
bg,
24+
background = "white",
2525
}) {
2626
const listComponent = featuresList && featuresList.length > 0 && (
2727
<List
@@ -70,7 +70,7 @@ export function FeatureSplit({
7070
);
7171

7272
return (
73-
<Layout id={id} subtitle={subtitle} title={title} bg={bg}>
73+
<Layout id={id} subtitle={subtitle} title={title} background={background}>
7474
<SimpleGrid
7575
cols={{ base: 1, md: 2 }}
7676
spacing={{ base: 40, md: 80 }}

src/components/FeaturesGrid.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ export function FeaturesGrid({
4040
id,
4141
subtitle,
4242
title,
43-
bg = "gray.0",
43+
background = "gray.0",
4444
items = [],
4545
}) {
4646
return (
47-
<Layout id={id} subtitle={subtitle} title={title} bg={bg}>
47+
<Layout id={id} subtitle={subtitle} title={title} background={background}>
4848
<Grid gutter="lg">
4949
{items.map((item, idx) => (
5050
<FeatureCard key={idx} {...item} />

src/components/Footer.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
SimpleGrid,
1010
ActionIcon,
1111
} from "@mantine/core";
12+
import { resolveBackground } from "../configs/backgrounds.js";
1213

1314
/**
1415
* Footer - A generic footer component with configurable sections and brand information.
@@ -23,8 +24,9 @@ export function Footer({
2324
socialLinks = [],
2425
copyrightText,
2526
madeByText,
26-
bg = "gray.0",
27+
background = "white",
2728
}) {
29+
const bg = resolveBackground(background);
2830
return (
2931
<Box
3032
component="footer"

src/components/Header.jsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Box, Container, Group, Paper, Text, Button } from "@mantine/core";
22
import { useWindowScroll } from "@mantine/hooks";
3+
import { resolveBackground } from "../configs/backgrounds.js";
34

45
/**
56
* Header - Fully config-driven navigation bar with accessibility.
@@ -10,7 +11,14 @@ import { useWindowScroll } from "@mantine/hooks";
1011
* @param {object} loginCta - { label, href }
1112
* @param {object} signupCta - { label, labelMobile, href }
1213
*/
13-
export function Header({ logo, navLinks = [], loginCta, signupCta }) {
14+
export function Header({
15+
logo,
16+
navLinks = [],
17+
loginCta,
18+
signupCta,
19+
background = "white",
20+
}) {
21+
const bg = resolveBackground(background);
1422
const [scroll] = useWindowScroll();
1523
const scrolled = scroll.y > 10;
1624

@@ -42,7 +50,7 @@ export function Header({ logo, navLinks = [], loginCta, signupCta }) {
4250
shadow={scrolled ? "sm" : "none"}
4351
radius="0"
4452
p="xs"
45-
bg="white"
53+
bg={bg}
4654
bd={
4755
scrolled
4856
? "1px solid var(--mantine-color-gray-2)"

src/components/Hero.jsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
import { SectionHeader } from "../primitives/SectionHeader.jsx";
1111
import { MediaBlock } from "../primitives/MediaBlock.jsx";
1212
import { CTAButton } from "../primitives/CTAButton.jsx";
13+
import { resolveBackground } from "../configs/backgrounds.js";
1314

1415
/**
1516
* Hero - High-impact first fold, fully config-driven.
@@ -21,9 +22,19 @@ import { CTAButton } from "../primitives/CTAButton.jsx";
2122
* @param {object} video - { src, filter, width }
2223
* @param {string} image - image src (alternative to video)
2324
*/
24-
export function Hero({ subtitle, title, description, cta, video, image }) {
25+
export function Hero({
26+
subtitle,
27+
title,
28+
description,
29+
cta,
30+
video,
31+
image,
32+
background = "white",
33+
}) {
34+
const bg = resolveBackground(background);
35+
2536
return (
26-
<Box py={{ base: 80, sm: 100, md: 140 }} id="hero" bg="white">
37+
<Box py={{ base: 80, sm: 100, md: 140 }} id="hero" bg={bg}>
2738
<Container size="lg">
2839
<SimpleGrid
2940
cols={{ base: 1, md: 2 }}

src/components/Layout.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Box, Container, Stack } from "@mantine/core";
22
import { SectionHeader } from "../primitives/SectionHeader.jsx";
3+
import { resolveBackground } from "../configs/backgrounds.js";
34

45
/**
56
* Layout - The "Stage" for the Zen Design Series
@@ -13,12 +14,14 @@ export function Layout({
1314
title,
1415
subtitle,
1516
id,
16-
bg = "white",
17+
background = "white",
1718
py = { base: 80, md: 120 },
1819
maw = 800,
1920
ta = "left",
2021
stackGap = "xl",
2122
}) {
23+
const bg = resolveBackground(background);
24+
2225
return (
2326
<Box
2427
component="section"

src/components/Pricing.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,16 @@ export function Pricing({
2828
setBilling,
2929
promoBadge,
3030
plans,
31+
background = "white",
3132
}) {
3233
return (
33-
<Layout id={id} subtitle={subtitle} title={title} ta="center">
34+
<Layout
35+
id={id}
36+
subtitle={subtitle}
37+
title={title}
38+
ta="center"
39+
background={background}
40+
>
3441
{billingOptions && billingOptions.length > 0 && (
3542
<Stack align="center" gap="xl" mb={80}>
3643
<Group gap="xs">

0 commit comments

Comments
 (0)