From 63e6e4c139007caae946f35942a5bba12fcc735f Mon Sep 17 00:00:00 2001 From: uncoolzero <107518216+uncoolzero@users.noreply.github.com> Date: Wed, 15 Nov 2023 19:30:53 -0300 Subject: [PATCH] Add Total Stalk Grown display --- projects/ui/src/components/Silo/Overview.tsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/projects/ui/src/components/Silo/Overview.tsx b/projects/ui/src/components/Silo/Overview.tsx index 1f7d3ad908..c09b6379ad 100644 --- a/projects/ui/src/components/Silo/Overview.tsx +++ b/projects/ui/src/components/Silo/Overview.tsx @@ -11,7 +11,6 @@ import { displayPercentage, displayStalk, displayUSD, - STALK_PER_SEED_PER_SEASON, } from '~/util'; import { ChipLabel, StyledTab } from '~/components/Common/Tabs'; import { ZERO_BN } from '~/constants'; @@ -27,6 +26,7 @@ import useMigrationNeeded from '~/hooks/farmer/useMigrationNeeded'; import stalkIconWinter from '~/img/beanstalk/stalk-icon-green.svg'; import seedIconWinter from '~/img/beanstalk/seed-icon-green.svg'; import { MigrateTab } from '~/components/Silo/MigrateTab'; +import useFarmerSiloBalances from '~/hooks/farmer/useFarmerSiloBalances'; const depositStats = (s: BigNumber, v: BigNumber[], d: string) => ( token.deposited.crates).flat(Infinity) + + let totalStalkGrown = farmerSilo.stalk.grown; + + deposits.forEach((deposit: any) => { + totalStalkGrown = totalStalkGrown.plus(deposit.stalk.grown) + }) + const stalkStats = useCallback( (s: BigNumber, v: BigNumber[], d: string) => ( <> @@ -107,10 +116,10 @@ const Overview: FC<{ sx={{ minWidth: 200, ml: 0 }} /> ), - [farmerSilo, ownership] + [ownership, totalStalkGrown] ); return (