From 31a2a39fded386eb0abbdd552cf0c86ef427a754 Mon Sep 17 00:00:00 2001 From: Caleb Cox Date: Mon, 9 Dec 2024 14:33:00 -0600 Subject: [PATCH] Add graph colors to theme --- .../DonationHistories/DonationHistories.tsx | 25 ++++++++--- .../HealthIndicatorGraph.tsx | 23 +++++++--- src/theme.ts | 43 ++++++++++++++++--- 3 files changed, 70 insertions(+), 21 deletions(-) diff --git a/src/components/Dashboard/DonationHistories/DonationHistories.tsx b/src/components/Dashboard/DonationHistories/DonationHistories.tsx index a4153f3dd..843907d99 100644 --- a/src/components/Dashboard/DonationHistories/DonationHistories.tsx +++ b/src/components/Dashboard/DonationHistories/DonationHistories.tsx @@ -8,6 +8,7 @@ import { Skeleton, Theme, Typography, + useTheme, } from '@mui/material'; import { DateTime } from 'luxon'; import { useTranslation } from 'react-i18next'; @@ -82,11 +83,17 @@ const DonationHistories = ({ setTime, }: Props): ReactElement => { const { classes } = useStyles(); + const { palette } = useTheme(); const { push } = useRouter(); const { t } = useTranslation(); const locale = useLocale(); const accountListId = useAccountListId(); - const fills = ['#FFCF07', '#30F2F2', '#1FC0D2', '#007398']; + const fills = [ + palette.cruYellow.main, + palette.graphBlue3.main, + palette.graphBlue2.main, + palette.graphBlue1.main, + ]; const currencies: { dataKey: string; fill: string }[] = []; const periods = reportsDonationHistories?.periods?.map((period) => { const data: { @@ -157,7 +164,7 @@ const DonationHistories = ({ | @@ -194,7 +201,7 @@ const DonationHistories = ({ @@ -238,19 +245,19 @@ const DonationHistories = ({ {goal && ( )} {pledged && ( )} @@ -294,7 +301,11 @@ const DonationHistories = ({ - + )} diff --git a/src/components/Reports/HealthIndicatorReport/HealthIndicatorGraph/HealthIndicatorGraph.tsx b/src/components/Reports/HealthIndicatorReport/HealthIndicatorGraph/HealthIndicatorGraph.tsx index f0100b506..50fbee415 100644 --- a/src/components/Reports/HealthIndicatorReport/HealthIndicatorGraph/HealthIndicatorGraph.tsx +++ b/src/components/Reports/HealthIndicatorReport/HealthIndicatorGraph/HealthIndicatorGraph.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Card, CardContent, CardHeader } from '@mui/material'; +import { Card, CardContent, CardHeader, useTheme } from '@mui/material'; import { useTranslation } from 'react-i18next'; import { Bar, @@ -25,18 +25,23 @@ export const HealthIndicatorGraph: React.FC = ({ accountListId, }) => { const { t } = useTranslation(); + const { palette } = useTheme(); const { loading, average, periods } = useGraphData(accountListId); const stacks = [ - { field: 'ownership', label: t('Ownership'), color: '#FFCF07' }, - { field: 'success', label: t('Success'), color: '#30F2F2' }, + { + field: 'ownership', + label: t('Ownership'), + color: palette.cruYellow.main, + }, + { field: 'success', label: t('Success'), color: palette.graphBlue1.main }, { field: 'consistency', label: t('Consistency'), - color: '#1FC0D2', + color: palette.graphBlue2.main, }, - { field: 'depth', label: t('Depth'), color: '#007398' }, + { field: 'depth', label: t('Depth'), color: palette.graphBlue3.main }, ]; if (periods?.length === 0) { @@ -64,7 +69,7 @@ export const HealthIndicatorGraph: React.FC = ({ ) } @@ -91,7 +96,11 @@ export const HealthIndicatorGraph: React.FC = ({ } /> {average !== null && ( - + )}