Skip to content

Commit

Permalink
feat: add available staking in vesting view
Browse files Browse the repository at this point in the history
  • Loading branch information
evavirseda committed Dec 27, 2024
1 parent aa93858 commit 1ae8de2
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions apps/wallet-dashboard/app/(protected)/vesting/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import {
Button,
ButtonType,
LoadingIndicator,
LabelText,
LabelTextSize,
} from '@iota/apps-ui-kit';
import {
Theme,
Expand Down Expand Up @@ -150,6 +152,11 @@ export default function VestingDashboardPage(): JSX.Element {
IOTA_TYPE_ARG,
);

const [formattedAvailableStaking, availableStakingSymbol] = useFormatCoin(
supplyIncreaseVestingSchedule.availableStaking,
IOTA_TYPE_ARG,
);

function handleOnSuccess(digest: string): void {
setTimelockedObjectsToUnstake(null);

Expand Down Expand Up @@ -221,7 +228,7 @@ export default function VestingDashboardPage(): JSX.Element {
<Panel>
<Title title="Vesting" size={TitleSize.Medium} />
<div className="flex flex-col gap-md p-lg pt-sm">
<div className="flex h-24 flex-row gap-4">
<div className="flex h-24 flex-row gap-md">
<DisplayStats
label="Total Vested"
value={formattedTotalVested}
Expand Down Expand Up @@ -320,8 +327,8 @@ export default function VestingDashboardPage(): JSX.Element {
}
/>

<div className="flex flex-col px-lg py-sm">
<div className="flex flex-row gap-md">
<div className="flex flex-col gap-y-md px-lg py-sm">
<div className="flex flex-row gap-x-md">
<DisplayStats
label="Your stake"
value={`${totalStakedFormatted} ${totalStakedSymbol}`}
Expand All @@ -331,6 +338,21 @@ export default function VestingDashboardPage(): JSX.Element {
value={`${totalEarnedFormatted} ${totalEarnedSymbol}`}
/>
</div>
<div className="flex w-full">
<Card type={CardType.Filled}>
<CardBody
title=""
subtitle={
<LabelText
size={LabelTextSize.Large}
label="Available for staking"
text={formattedAvailableStaking}
supportingLabel={availableStakingSymbol}
/>
}
/>
</Card>
</div>
</div>
<div className="flex flex-col px-lg py-sm">
<div className="flex w-full flex-col items-center justify-center space-y-4 pt-4">
Expand Down

0 comments on commit 1ae8de2

Please sign in to comment.