From ed97436f4396085b9ddd42c292eb181bdcf12163 Mon Sep 17 00:00:00 2001 From: Anup Singh Date: Mon, 22 Dec 2025 12:24:22 +0530 Subject: [PATCH 1/2] fix: interest are now visible --- .../sidepanel/sections/ProfileSummary.tsx | 12 ++++- .../sidepanel/sections/profile/Interests.tsx | 50 ++++++++++++++++--- 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/src/pages/sidepanel/sections/ProfileSummary.tsx b/src/pages/sidepanel/sections/ProfileSummary.tsx index 04c220f..76a88f6 100644 --- a/src/pages/sidepanel/sections/ProfileSummary.tsx +++ b/src/pages/sidepanel/sections/ProfileSummary.tsx @@ -92,6 +92,16 @@ const ProfileSummary: React.FC = ({ profile }) => { return attributes.length > 0 ? attributes[0] : 'Unknown'; }, [profile?.data?.user]); + const interestsArray = useMemo(() => { + const lyticsContent = profile?.data?.user?.lytics_content; + if (!lyticsContent || typeof lyticsContent !== 'object') return []; + + return Object.entries(lyticsContent).map(([label, value]) => ({ + label, + value: Math.round((typeof value === 'number' ? value : 0) * 100), + })); + }, [profile?.data?.user?.lytics_content]); + return ( = ({ profile }) => { /> )} - + diff --git a/src/pages/sidepanel/sections/profile/Interests.tsx b/src/pages/sidepanel/sections/profile/Interests.tsx index b120c73..fe61a09 100644 --- a/src/pages/sidepanel/sections/profile/Interests.tsx +++ b/src/pages/sidepanel/sections/profile/Interests.tsx @@ -1,13 +1,18 @@ import React from 'react'; -import { Box, Stack, Typography, Link } from '@mui/material'; +import { Box, Stack, Typography, Link, LinearProgress } from '@mui/material'; import { styled } from '@mui/material/styles'; import { Lock } from '@mui/icons-material'; import { appColors } from '@root/src/theme/palette'; import { appContent } from '@root/src/shared/content/appContent'; +interface Interest { + label: string; + value: number; +} + interface InterestsProps { hasData: boolean; - interests?: string[]; + interests?: Interest[]; textContent?: typeof appContent.interests; } @@ -68,11 +73,33 @@ const StyledLink = styled(Link)(() => ({ }, })); -const ContentText = styled(Typography)(() => ({ +const InterestsContainer = styled(Stack)(({ theme }) => ({ + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(1), +})); + +const InterestRow = styled(Stack)(({ theme }) => ({ + display: 'flex', + flexDirection: 'column', + gap: theme.spacing(0.5), +})); + +const InterestLabel = styled(Typography)(() => ({ fontSize: appColors.common.fontSize.baseSmall, - color: appColors.neutral[600], - lineHeight: appColors.common.lineHeight.tight, fontWeight: appColors.common.fontWeight.medium, + color: appColors.neutral[900], +})); + +const StyledLinearProgress = styled(LinearProgress)(({ theme }) => ({ + width: '100%', + height: '0.5rem', // 8px + borderRadius: theme.spacing(0.5), + backgroundColor: appColors.common.colors.accentLight, + '& .MuiLinearProgress-bar': { + backgroundColor: appColors.common.colors.accent, + borderRadius: theme.spacing(0.5), + }, })); export const Interests = ({ @@ -85,7 +112,18 @@ export const Interests = ({ {textContent.title} {hasData && interests.length > 0 ? ( - {interests.join(', ')} + + {interests.map((interest, index) => ( + + {interest.label} + + + ))} + ) : (