Skip to content

Commit 10f8782

Browse files
evavirsedamarc2332brancoder
authored
feat(wallet/dashboard): show negative value for vested staking (#6838)
# Description of change ![Screenshot from 2025-05-09 13-04-56](https://github.com/user-attachments/assets/2f8490e9-f310-40ca-bc45-263f846b445e) ## Links to any relevant issues fixes #6742 ## Type of change Choose a type of change, and delete any options that are not relevant. - Bug fix (a non-breaking change which fixes an issue) - Enhancement (a non-breaking change which adds functionality) - Breaking change (fix or feature that would cause existing functionality to not work as expected) - Documentation Fix ## How the change has been tested Describe the tests that you ran to verify your changes. Make sure to provide instructions for the maintainer as well as any relevant configurations. - [ ] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) ### Infrastructure QA (only required for crates that are maintained by @iotaledger/infrastructure) - [ ] Synchronization of the indexer from genesis for a network including migration objects. - [ ] Restart of indexer synchronization locally without resetting the database. - [ ] Restart of indexer synchronization on a production-like database. - [ ] Deployment of services using Docker. - [ ] Verification of API backward compatibility. ## Change checklist Tick the boxes that are relevant to your changes, and delete any items that are not. - [ ] I have followed the contribution guidelines for this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have checked that new and existing unit tests pass locally with my changes ### Release Notes <!-- Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. --> - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --------- Co-authored-by: Marc Espin <[email protected]> Co-authored-by: Bran <[email protected]>
1 parent 5f15a2a commit 10f8782

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

apps/core/src/utils/stake/getTransactionAmountForTimelocked.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function getTransactionAmountForTimelocked(
1313

1414
if (isTimelockedStaking) {
1515
const { totalStakedAmount } = getStakeDetailsFromEvents(events);
16-
return totalStakedAmount;
16+
return -BigInt(totalStakedAmount);
1717
} else if (isTimelockedUnstaking) {
1818
const { totalUnstakeAmount } = getUnstakeDetailsFromEvents(events);
1919
return totalUnstakeAmount;

apps/wallet-dashboard/app/(protected)/staking/page.tsx

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -259,29 +259,27 @@ function StakingDashboardPage(): React.JSX.Element {
259259
)}
260260
</Panel>
261261
) : (
262-
<div className="flex h-[270px] p-lg">
262+
<div className="flex h-[270px] py-lg">
263263
<StartStaking />
264264
</div>
265265
)}
266266
{hasAvailableVestedStaking && supplyIncreaseVestingEnabled && (
267-
<div className="px-lg">
268-
<Panel bgColor="bg-secondary-90 dark:bg-secondary-10">
269-
<div className="py-sm">
270-
<Title
271-
title="Available Vested Staking"
272-
subtitle="In progress vested staking"
273-
trailingElement={
274-
<Button
275-
onClick={() => router.push('/vesting')}
276-
size={ButtonSize.Small}
277-
type={ButtonType.Outlined}
278-
text="View"
279-
/>
280-
}
281-
/>
282-
</div>
283-
</Panel>
284-
</div>
267+
<Panel bgColor="bg-secondary-90 dark:bg-secondary-10">
268+
<div className="py-sm">
269+
<Title
270+
title="Available Vested Staking"
271+
subtitle="In progress vested staking"
272+
trailingElement={
273+
<Button
274+
onClick={() => router.push('/vesting')}
275+
size={ButtonSize.Small}
276+
type={ButtonType.Outlined}
277+
text="View"
278+
/>
279+
}
280+
/>
281+
</div>
282+
</Panel>
285283
)}
286284
</div>
287285
</div>

0 commit comments

Comments
 (0)