Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { ComparisonTableProps } from './ComparisonTable.types';
import * as S from './ComparisonTable.styles';
import { Group } from '@mantine/core';
import { IconUser, IconCpu, IconListDetails, IconTag } from '@tabler/icons-react';
import { usePathname } from 'next/navigation';

// Replace framer-motion with CSS transitions
export const ComparisonTableDesktop: React.FC<ComparisonTableProps> = ({
Expand All @@ -13,6 +14,12 @@ export const ComparisonTableDesktop: React.FC<ComparisonTableProps> = ({
variant = 'default',
className,
}) => {
const pathname = usePathname();
const isHomePage = pathname === '/';

// Only use accent/dark variant on homepage
const effectiveVariant = isHomePage ? variant : 'default';

const [ref, inView] = useInView({
triggerOnce: true,
rootMargin: "-100px",
Expand All @@ -28,14 +35,14 @@ export const ComparisonTableDesktop: React.FC<ComparisonTableProps> = ({
}, [inView]);

// Determine icon color based on variant for headers
const headerIconColor = variant === 'accent' ? 'var(--mantine-color-white)' : 'var(--mantine-color-text)';
const headerIconColor = effectiveVariant === 'accent' ? 'var(--mantine-color-white)' : 'var(--mantine-color-text)';
// Icon color for body cells can be standard text color
const bodyIconColor = 'var(--mantine-color-text)';

return (
<S.Container className={className} ref={ref}>
<S.Table $variant={variant} className={isVisible ? 'visible' : ''}>
<S.TableHead $variant={variant}>
<S.Table $variant={effectiveVariant} className={isVisible ? 'visible' : ''}>
<S.TableHead $variant={effectiveVariant}>
<tr>
<S.TableHeaderCell>
<Group gap="xs" wrap="nowrap">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Stack, Card, Text, Title, Group, Divider, Box, useMantineTheme } from '
import { IconUser, IconCpu } from '@tabler/icons-react';
import * as S from './ComparisonTable.styles';
import { sectionContainerWithoutMarginStyle } from '../../pages/WhitePaper/components/AiAutopilotAnalogy/AiAutopilotAnalogy.styles'; // Import for padding values
import { usePathname } from 'next/navigation';

// Mobile version with stacked layout using Mantine components
export const ComparisonTableMobile: React.FC<ComparisonTableProps> = ({
Expand All @@ -14,10 +15,16 @@ export const ComparisonTableMobile: React.FC<ComparisonTableProps> = ({
variant = 'default', // Variant might influence mobile styling too
className,
}) => {
const pathname = usePathname();
const isHomePage = pathname === '/';

// Only use accent/dark variant on homepage
const effectiveVariant = isHomePage ? variant : 'default';

const theme = useMantineTheme();
const [ref, inView] = useInView({
triggerOnce: true,
rootMargin: "-50px", // Adjusted rootMargin for mobile
rootMargin: "-50px",
threshold: 0.1
});

Expand All @@ -29,63 +36,81 @@ export const ComparisonTableMobile: React.FC<ComparisonTableProps> = ({
}
}, [inView]);

const getBackgroundColor = (themeVariant: typeof variant) => {
return theme.white;
};
// Get color based on the variant and whether we're in a light context
const headerBgColor = effectiveVariant === 'accent'
? theme.colors.blue[7]
: theme.colors.gray[1];

const getTextColor = (themeVariant: typeof variant) => {
return theme.black;
};
const headerTextColor = effectiveVariant === 'accent'
? theme.white
: theme.black;

const categoryTitleColor = variant === 'accent' ? theme.colors.blue[6] : theme.primaryColor;

// Get horizontal padding from the shared style
const horizontalPadding = sectionContainerWithoutMarginStyle.paddingLeft; // Assuming paddingLeft and paddingRight are the same
const cardBgColor = theme.white;
const cardTextColor = theme.black;

return (
<Stack
ref={ref}
className={className}
gap="lg"
style={{
paddingLeft: horizontalPadding,
paddingRight: horizontalPadding,
}}
>
{items.map((item, index) => (
<Box ref={ref} className={className}>
<Stack gap="lg">
{/* Header Card */}
<Card
shadow="sm"
padding="lg"
p="md"
radius="md"
withBorder
key={index}
className={isVisible ? 'visible' : ''}
style={{
backgroundColor: headerBgColor,
opacity: isVisible ? 1 : 0,
transform: isVisible ? 'translateY(0)' : 'translateY(20px)',
transition: `opacity 0.5s ease-out ${index * 0.1}s, transform 0.5s ease-out ${index * 0.1}s`,
backgroundColor: getBackgroundColor(variant),
color: getTextColor(variant),
transition: 'opacity 0.3s ease, transform 0.5s ease',
}}
>
<Stack gap="xs">
<Title order={4} c={categoryTitleColor}>{item.category}</Title>
<Divider my="xs" />
<Group gap="xs" wrap="nowrap">
<IconUser size={18} color={getTextColor(variant)} />
<Text size="sm" fw={700} style={{ color: getTextColor(variant) }}>{leftTitle}:</Text>
<Stack align="center" gap="xs">
<Group gap="xs">
<IconUser size={20} color={headerTextColor} />
<Title order={5} style={{ color: headerTextColor }}>{leftTitle}</Title>
</Group>
<Text size="sm" style={{ color: getTextColor(variant), paddingLeft: '26px' }}>{item.leftContent}</Text>

<Divider my="xs" variant="dashed" />
<Group gap="xs" wrap="nowrap">
<IconCpu size={18} color={getTextColor(variant)} />
<Text size="sm" fw={700} style={{ color: getTextColor(variant) }}>{rightTitle}:</Text>
<Text size="sm" style={{ color: headerTextColor }}>vs.</Text>
<Group gap="xs">
<IconCpu size={20} color={headerTextColor} />
<Title order={5} style={{ color: headerTextColor }}>{rightTitle}</Title>
</Group>
<Text size="sm" style={{ color: getTextColor(variant), paddingLeft: '26px' }}>{item.rightContent}</Text>
</Stack>
</Card>
))}
</Stack>

{/* Comparison Cards */}
{items.map((item, index) => (
<Card
key={index}
p="lg"
radius="md"
style={{
backgroundColor: cardBgColor,
opacity: isVisible ? 1 : 0,
transform: isVisible ? 'translateY(0)' : 'translateY(20px)',
transition: `opacity 0.3s ease, transform 0.5s ease ${index * 0.1}s`,
}}
>
<Title order={6} mb="xs">{item.category}</Title>
<Divider mb="md" />

<Stack gap="md">
<Box>
<Group gap="xs" mb="xs">
<IconUser size={16} color={cardTextColor} />
<Text size="sm" fw={600}>{leftTitle}</Text>
</Group>
<Text size="sm">{item.leftContent}</Text>
</Box>

<Box>
<Group gap="xs" mb="xs">
<IconCpu size={16} color={cardTextColor} />
<Text size="sm" fw={600}>{rightTitle}</Text>
</Group>
<Text size="sm">{item.rightContent}</Text>
</Box>
</Stack>
</Card>
))}
</Stack>
</Box>
);
};
6 changes: 6 additions & 0 deletions src/shared-components/navigation/PageSubNav/SubNavLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ export const SubNavLink: React.FC<SubNavLinkProps> = ({ item, onClick, isExpande
pointerEvents: isClickable ? 'auto' : 'none',
// Dim only if not clickable
opacity: isClickable ? 1 : 0.7,
// Improve hover feedback with a more noticeable transition
transition: 'all 0.2s ease',
'&:hover': isClickable ? {
backgroundColor: isActive ? 'rgba(66, 153, 225, 0.1)' : 'rgba(0, 0, 0, 0.05)',
borderLeftColor: !isHeader && isInteractive ? theme.colors[theme.primaryColor][5] : undefined,
} : undefined,
},
label: {
// fontWeight handled in textStyle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Icon } from '../../atoms/Icon';
import { Body } from '../../atoms/Typography';
import { ProblemSolutionCardProps } from './ProblemSolutionCard.types';
import * as S from './ProblemSolutionCard.styles';
import { usePathname } from 'next/navigation';

/**
* ProblemSolutionCard displays a problem statement and its solution
Expand All @@ -15,45 +16,74 @@ export const ProblemSolutionCard: React.FC<ProblemSolutionCardProps> = ({
impact,
icon,
className,
variant = 'white',
}) => {
const pathname = usePathname();
// Apply 'white' variant for all non-homepage paths to ensure light background
const isHomePage = pathname === '/';
const effectiveVariant = isHomePage ? variant : 'white';

return (
<S.StyledCard $variant="white" className={className}>
<S.IconHeader>
<S.HeaderIcon>
<Icon name={icon || 'chart-bar'} />
</S.HeaderIcon>
<S.HeaderSlug>{slug}</S.HeaderSlug>
</S.IconHeader>
<S.StyledCard className={className} $variant={effectiveVariant}>
{slug && (
<S.IconHeader>
<S.HeaderIcon>
{icon && <Icon name={icon} size={24} />}
</S.HeaderIcon>
<S.HeaderSlug>{slug}</S.HeaderSlug>
</S.IconHeader>
)}

<S.Content $variant="white">
<S.Section>
<S.StatusIcon type="problem">
<Icon name="x" />
</S.StatusIcon>
<S.TextContent>
<Body>{problem}</Body>
</S.TextContent>
</S.Section>
<S.Content $variant={effectiveVariant}>
{problem && (
<S.Section>
<S.StatusIcon type="problem">
<Icon name="alertTriangle" size={18} />
</S.StatusIcon>
<S.TextContent>
<Body weight="semibold" color={effectiveVariant === 'blue' ? 'light' : 'primary'}>
Problem
</Body>
<Body weight="regular" color={effectiveVariant === 'blue' ? 'light' : 'secondary'}>
{problem}
</Body>
</S.TextContent>
</S.Section>
)}

<S.Section>
<S.StatusIcon type="solution">
<Icon name="check" />
</S.StatusIcon>
<S.TextContent>
<Body>{solution}</Body>
</S.TextContent>
</S.Section>
{solution && (
<S.Section>
<S.StatusIcon type="solution">
<Icon name="checkCircle" size={18} />
</S.StatusIcon>
<S.TextContent>
<Body weight="semibold" color={effectiveVariant === 'blue' ? 'light' : 'primary'}>
Solution
</Body>
<Body weight="regular" color={effectiveVariant === 'blue' ? 'light' : 'secondary'}>
{solution}
</Body>
</S.TextContent>
</S.Section>
)}

{impact && (
<S.Section>
<S.StatusIcon type="impact">
<Icon name="chart-bar" />
<Icon name="trendingUp" size={18} />
</S.StatusIcon>
<S.TextContent>
<Body weight="semibold" color={effectiveVariant === 'blue' ? 'light' : 'primary'}>
Impact
</Body>
<S.ImpactTextWrapper>
<Body weight="bold">{impact.value}</Body>
<Body weight="bold">
{impact.value}
</Body>
{impact.label && (
<Body color="secondary">{impact.label}</Body>
<Body weight="regular" color={effectiveVariant === 'blue' ? 'light' : 'secondary'}>
{impact.label}
</Body>
)}
</S.ImpactTextWrapper>
</S.TextContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,18 @@ export const ItemIcon = styled.div<{ theme: MantineTheme }>`
width: 40px;
height: 40px;
border-radius: ${({ theme }) => theme.radius.sm};
background-color: ${({ theme }) => theme.colors.gray[0]};
background-color: #f0f0f0;
padding: ${({ theme }) => theme.spacing.xs};
flex-shrink: 0;
border: 1px solid #e0e0e0;
box-shadow: 0 2px 4px rgba(0,0,0,0.05);
color: ${({ theme }) => theme.colors[theme.primaryColor][6]};

svg {
width: 100%;
height: 100%;
object-fit: contain;
}
`;

export const ItemContent = styled.div`
Expand All @@ -95,7 +104,7 @@ export const ItemContent = styled.div`
export const ItemTitle = styled.h4<{ theme: MantineTheme }>`
font-size: ${({ theme }) => theme.fontSizes.lg};
margin: 0 0 ${({ theme }) => theme.spacing.xs} 0;
color: ${({ theme }) => theme.black};
color: ${({ theme }) => theme.colors.gray[8]};
word-break: break-word;
display: flex;
align-items: center;
Expand Down
Loading
Loading