From 106211a5789ff65a39ceadfaa943c6a2edbd9802 Mon Sep 17 00:00:00 2001 From: LewisB Date: Fri, 25 Oct 2024 11:26:31 +0700 Subject: [PATCH] add typing --- packages/app/src/hooks/useTotalStats.ts | 2 +- packages/app/src/pages/HomePage.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/app/src/hooks/useTotalStats.ts b/packages/app/src/hooks/useTotalStats.ts index e6f18416..278098ba 100644 --- a/packages/app/src/hooks/useTotalStats.ts +++ b/packages/app/src/hooks/useTotalStats.ts @@ -6,7 +6,7 @@ import { formatGoodDollarAmount } from '../lib/calculateGoodDollarAmounts'; type StatsFormatted = { amount: string; }; -type TotalStats = { +export type TotalStats = { totalDonations: StatsFormatted; totalPools: StatsFormatted; totalMembers: StatsFormatted; diff --git a/packages/app/src/pages/HomePage.tsx b/packages/app/src/pages/HomePage.tsx index f8f96b87..3aaa167b 100644 --- a/packages/app/src/pages/HomePage.tsx +++ b/packages/app/src/pages/HomePage.tsx @@ -3,6 +3,7 @@ import { Box, HStack, ScrollView, Spinner, Text, useBreakpointValue, VStack } fr import { Platform } from 'react-native'; import { useTotalStats } from '../hooks'; +import type { TotalStats } from '../hooks'; import { useScreenSize } from '../theme/hooks'; import ActionButton from '../components/ActionButton'; @@ -53,7 +54,7 @@ const CollectivesContainer: FC = ({ children }) => { ); }; -const statsCopy = { +const statsCopy: { [K in keyof TotalStats]: { copy: string } } = { totalPools: { copy: 'GoodCollective pools', },