Skip to content

Commit db4c652

Browse files
committed
feat: Enhance CallToAction component with subtitle and icon support
- Added optional subtitle and icon props to CallToAction component for improved flexibility. - Refactored layout to utilize Stack and Group components for better alignment and spacing. - Updated styles to dynamically adjust background and text colors based on the variant prop. - Introduced new VerticalStackContainer and styled components in BrainGardenSurvival for consistent layout. - Enhanced JourneyConclusion component to conditionally render text for better mobile experience.
1 parent d1fb94b commit db4c652

File tree

5 files changed

+656
-242
lines changed

5 files changed

+656
-242
lines changed

src/shared-components/molecules/CallToAction/CallToAction.tsx

Lines changed: 73 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,97 @@
11
import React from 'react';
2-
import { Title, Text, Button, Paper } from '@mantine/core';
2+
import { Title, Text, Button, Paper, Stack, Group, ThemeIcon } from '@mantine/core';
33
import { CallToActionProps } from './CallToAction.types';
44

55
export const CallToAction: React.FC<CallToActionProps> = ({
66
title,
7+
subtitle,
78
description,
89
buttonText,
910
buttonLink,
10-
variant = 'primary'
11+
variant = 'primary',
12+
icon
1113
}) => {
14+
const background = variant === 'secondary'
15+
? 'var(--mantine-color-gray-0)'
16+
: 'linear-gradient(135deg, var(--mantine-color-blue-6), var(--mantine-color-cyan-6))';
17+
const textColor = variant === 'secondary' ? 'var(--mantine-color-black)' : 'white';
18+
const titleColor = variant === 'secondary' ? 'var(--mantine-color-blue-7)' : 'white';
19+
const buttonVariant = variant === 'secondary' ? 'gradient' : 'white';
20+
const iconColor = variant === 'secondary' ? 'blue' : 'white';
21+
1222
return (
1323
<Paper
1424
p="xl"
1525
radius="md"
1626
shadow="md"
1727
style={{
18-
background: 'linear-gradient(135deg, var(--mantine-color-blue-6), var(--mantine-color-cyan-6))',
19-
padding: 'var(--mantine-spacing-xl) var(--mantine-spacing-xl)',
28+
background: background,
2029
textAlign: 'center',
2130
}}
2231
>
23-
<Title
24-
order={2}
25-
mb="md"
26-
style={{
27-
color: 'white',
28-
fontSize: '1.75rem',
29-
fontWeight: 700,
30-
}}
31-
>
32-
{title}
33-
</Title>
34-
{description && (
35-
<Text
36-
mb="xl"
32+
<Stack align="center" gap="md">
33+
<Group justify="center" gap="sm">
34+
{icon && (
35+
<ThemeIcon
36+
variant={variant === 'secondary' ? 'light' : 'light'}
37+
color={iconColor}
38+
radius="xl"
39+
size="lg"
40+
>
41+
{icon}
42+
</ThemeIcon>
43+
)}
44+
<Stack gap={0} align="center">
45+
<Title
46+
order={2}
47+
style={{
48+
color: titleColor,
49+
fontSize: '1.75rem',
50+
fontWeight: 700,
51+
}}
52+
>
53+
{title}
54+
</Title>
55+
{subtitle && (
56+
<Text
57+
size="sm"
58+
mt={2}
59+
style={{ color: textColor, opacity: 0.8 }}
60+
>
61+
{subtitle}
62+
</Text>
63+
)}
64+
</Stack>
65+
</Group>
66+
67+
{description && (
68+
<Text
69+
style={{
70+
color: textColor,
71+
opacity: 0.9,
72+
maxWidth: 600,
73+
}}
74+
>
75+
{description}
76+
</Text>
77+
)}
78+
<Button
79+
component="a"
80+
href={buttonLink}
81+
target="_blank"
82+
rel="noopener noreferrer"
83+
size="md"
84+
variant={buttonVariant}
85+
gradient={variant === 'secondary' ? { from: 'blue', to: 'cyan' } : undefined}
3786
style={{
38-
color: 'white',
39-
opacity: 0.9,
40-
maxWidth: 600,
41-
margin: '0 auto',
87+
fontWeight: 600,
88+
transition: 'all 0.2s ease',
89+
marginTop: 'var(--mantine-spacing-sm)'
4290
}}
4391
>
44-
{description}
45-
</Text>
46-
)}
47-
<Button
48-
component="a"
49-
href={buttonLink}
50-
target="_blank"
51-
rel="noopener noreferrer"
52-
size="lg"
53-
variant="white"
54-
style={{
55-
fontWeight: 600,
56-
transition: 'all 0.2s ease',
57-
}}
58-
>
59-
{buttonText}
60-
</Button>
92+
{buttonText}
93+
</Button>
94+
</Stack>
6195
</Paper>
6296
);
6397
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
import { ReactNode } from 'react';
2+
13
export interface CallToActionProps {
24
title: string;
5+
subtitle?: string;
36
description?: string;
47
buttonText: string;
58
buttonLink: string;
69
variant?: 'primary' | 'secondary';
10+
icon?: ReactNode;
711
}

src/shared-components/pages/WhitePaper/components/BrainGardenSurvival/BrainGardenSurvival.styles.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import styled from 'styled-components';
22
import { motion } from 'framer-motion';
3+
import { Box, Card, Container, List, Text } from '@mantine/core';
34

45
// Spacing constants for consistent layout
56
const SPACING = {
@@ -349,4 +350,76 @@ export const LargeDescriptionText = styled.div`
349350

350351
export const ScrollableSection = styled.div`
351352
scroll-margin-top: 100px;
353+
`;
354+
355+
// New Vertical Stack Container
356+
export const VerticalStackContainer = styled(Box)`
357+
display: flex;
358+
flex-direction: column;
359+
gap: 1.75rem; /* Reduced gap */
360+
width: 100%;
361+
margin: 0 auto; /* Keep centering */
362+
padding-left: 1rem; /* px-4 */
363+
padding-right: 1rem; /* px-4 */
364+
365+
@media (min-width: ${({ theme }) => theme.breakpoints.sm}) {
366+
padding-left: 1.5rem; /* sm:px-6 */
367+
padding-right: 1.5rem; /* sm:px-6 */
368+
}
369+
370+
@media (min-width: ${({ theme }) => theme.breakpoints.lg}) {
371+
padding-left: 2rem; /* lg:px-8 */
372+
padding-right: 2rem; /* lg:px-8 */
373+
}
374+
`;
375+
376+
export const StyledContainer = styled(Container)`
377+
padding-top: 4rem;
378+
`;
379+
380+
// Subtle divider for transition
381+
export const TransitionDivider = styled(Box)`
382+
height: 1px;
383+
background: linear-gradient(to right, transparent, ${({ theme }) => theme.colors.gray[3]}, transparent);
384+
margin-top: 1rem; // Add some space above the divider
385+
margin-bottom: 2rem; // Add space below the divider before the next section
386+
opacity: 0.6;
387+
`;
388+
389+
// Centering styles for SectionTitle in Card 1
390+
export const CenteredTitle = styled.div`
391+
text-align: center;
392+
margin-bottom: 0 !important; // Override default margin if necessary
393+
394+
h2 {
395+
margin-bottom: 0 !important; // Target the h2 specifically
396+
}
397+
`;
398+
399+
// Wrapper to center content within specific cards
400+
export const CenteredContentWrapper = styled(Box)`
401+
max-width: 720px; /* Max width for readable text */
402+
margin-left: auto;
403+
margin-right: auto;
404+
width: 100%; /* Ensure it takes full width up to max-width */
405+
`;
406+
407+
// Icon wrapper for Card 2
408+
export const IconWrapper = styled.div`
409+
background-color: ${({ theme }) => theme.colors.blue[0]}; /* bg-blue-100 */
410+
color: ${({ theme }) => theme.colors.blue[6]}; /* text-blue-600 */
411+
border-radius: 50%; /* rounded-full */
412+
padding: ${({ theme }) => theme.spacing.xs}; /* p-2ish */
413+
display: inline-flex; /* To fit content */
414+
align-items: center;
415+
justify-content: center;
416+
box-shadow: ${({ theme }) => theme.shadows.sm};
417+
`;
418+
419+
// Styled callout for Card 5
420+
export const HighlightCallout = styled.div`
421+
background-color: ${({ theme }) => theme.colors.blue[0]};
422+
border-left: 4px solid ${({ theme }) => theme.colors.blue[5]};
423+
border-radius: ${({ theme }) => theme.radius.sm};
424+
padding: ${({ theme }) => theme.spacing.md};
352425
`;

0 commit comments

Comments
 (0)