Skip to content

Commit

Permalink
fix ui build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Space-Bean committed Oct 9, 2024
1 parent 669db5b commit 512b6a3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion projects/ui/src/components/Analytics/Silo/Seeds.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { FC } from '~/types';
import { SeasonalSeedsDocument, SeasonalSeedsQuery } from '~/generated/graphql';

const getValue = (season: SnapshotData<SeasonalSeedsQuery>) =>
toTokenUnitsBN(season.seeds, SEEDS.decimals).toNumber();
toTokenUnitsBN(season.grownStalkPerSeason, SEEDS.decimals).toNumber();
const formatValue = (value: number) =>
`${value.toLocaleString('en-US', { maximumFractionDigits: 0 })}`;
const statProps = {
Expand Down
2 changes: 1 addition & 1 deletion projects/ui/src/components/Silo/RewardsSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 15 additions & 4 deletions projects/ui/src/util/Interpolate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const addBufferSeasons = (
points: BaseDataPoint[],
num: number = 24,
whitelist: ReturnType<typeof useWhitelistedTokens>['whitelist'],
itemizeByToken: boolean = false,
itemizeByToken: boolean = false
) => {
if (points.length === 0) return [];
const d = DateTime.fromJSDate(points[0].date);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -278,5 +284,10 @@ export const interpolateFarmerDepositedValue = (
currBDV = thisBDV;
}

return addBufferSeasons(points, bufferSeasons, whitelist, Boolean(currBDVByToken));
return addBufferSeasons(
points,
bufferSeasons,
whitelist,
Boolean(currBDVByToken)
);
};

0 comments on commit 512b6a3

Please sign in to comment.