From 512b6a34eb0bf900ba60a9ed554294e16a390664 Mon Sep 17 00:00:00 2001 From: Spacebean Date: Wed, 9 Oct 2024 12:11:38 -0600 Subject: [PATCH] fix ui build errors --- .../src/components/Analytics/Silo/Seeds.tsx | 2 +- .../ui/src/components/Silo/RewardsSummary.tsx | 2 +- projects/ui/src/util/Interpolate.ts | 19 +++++++++++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/projects/ui/src/components/Analytics/Silo/Seeds.tsx b/projects/ui/src/components/Analytics/Silo/Seeds.tsx index 9de4539171..94e5540ad1 100644 --- a/projects/ui/src/components/Analytics/Silo/Seeds.tsx +++ b/projects/ui/src/components/Analytics/Silo/Seeds.tsx @@ -11,7 +11,7 @@ import { FC } from '~/types'; import { SeasonalSeedsDocument, SeasonalSeedsQuery } from '~/generated/graphql'; const getValue = (season: SnapshotData) => - toTokenUnitsBN(season.seeds, SEEDS.decimals).toNumber(); + toTokenUnitsBN(season.grownStalkPerSeason, SEEDS.decimals).toNumber(); const formatValue = (value: number) => `${value.toLocaleString('en-US', { maximumFractionDigits: 0 })}`; const statProps = { diff --git a/projects/ui/src/components/Silo/RewardsSummary.tsx b/projects/ui/src/components/Silo/RewardsSummary.tsx index 69d9f90233..3e17f4b99a 100644 --- a/projects/ui/src/components/Silo/RewardsSummary.tsx +++ b/projects/ui/src/components/Silo/RewardsSummary.tsx @@ -16,7 +16,7 @@ import { hoverMap } from '../../constants/silo'; export type RewardsBarProps = { beans: FarmerSiloRewards['beans']; stalk: FarmerSiloRewards['stalk']; - seeds: FarmerSiloRewards['grownStalkPerSeaason']; + seeds: FarmerSiloRewards['seeds']; /// TEMP revitalizedStalk?: BigNumber; revitalizedSeeds?: BigNumber; diff --git a/projects/ui/src/util/Interpolate.ts b/projects/ui/src/util/Interpolate.ts index 55e62bad42..8139922125 100644 --- a/projects/ui/src/util/Interpolate.ts +++ b/projects/ui/src/util/Interpolate.ts @@ -42,7 +42,7 @@ export const addBufferSeasons = ( points: BaseDataPoint[], num: number = 24, whitelist: ReturnType['whitelist'], - itemizeByToken: boolean = false, + itemizeByToken: boolean = false ) => { if (points.length === 0) return []; const d = DateTime.fromJSDate(points[0].date); @@ -129,8 +129,14 @@ export const interpolateFarmerStalk = ( // Reached a data point for which we have a snapshot. // Use the corresponding total stalk value. currStalk = toTokenUnitsBN(snapshots[j].stalk, STALK.decimals); - currSeeds = toTokenUnitsBN(snapshots[j].seeds, SEEDS.decimals); - lastSeedsSnapshot = toTokenUnitsBN(snapshots[j].seeds, SEEDS.decimals); + currSeeds = toTokenUnitsBN( + snapshots[j].grownStalkPerSeason, + SEEDS.decimals + ); + lastSeedsSnapshot = toTokenUnitsBN( + snapshots[j].grownStalkPerSeason, + SEEDS.decimals + ); currGrownStalk = toTokenUnitsBN(BigNumber(0), STALK.decimals); currTimestamp = DateTime.fromJSDate( secondsToDate(snapshots[j].createdAt) @@ -278,5 +284,10 @@ export const interpolateFarmerDepositedValue = ( currBDV = thisBDV; } - return addBufferSeasons(points, bufferSeasons, whitelist, Boolean(currBDVByToken)); + return addBufferSeasons( + points, + bufferSeasons, + whitelist, + Boolean(currBDVByToken) + ); };