8000 refactor(portfolio): migrate balance cards to runes by yhabib · Pull Request #6853 · dfinity/nns-dapp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

refactor(portfolio): migrate balance cards to runes #6853

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 21, 2025

Conversation

yhabib
Copy link
Contributor
@yhabib yhabib commented May 19, 2025

Motivation

We want to introduce a toggle that allows users to hide or show their balances on the main pages. This PR migrates the two cards displaying balances in the Portfolio page to use Svelte runes, simplifying future changes to implement the visibility toggle.

NNS1-3721

Changes

  • Migrate HeldTokensCard to runes.
  • Migrate StakedTokensCard to runes.
  • Migrate TokensCardHeader to runes.

Tests

  • No logical changes have been made, so the tests should pass as they did before.

Todos

  • Add entry to changelog (if necessary).
    Not necessary.

@yhabib yhabib force-pushed the nns1-3721/prework-portfolio branch from 429c78e to 18d7b3e Compare May 19, 2025 15:26
@yhabib yhabib marked this pull request as ready for review May 19, 2025 15:28
@yhabib yhabib requested a review from a team as a code owner May 19, 2025 15:28
@yhabib yhabib force-pushed the nns1-3721/prework-portfolio branch from 18d7b3e to 10d9721 Compare May 21, 2025 15:00
@yhabib yhabib requested review from mstrasinskis and Copilot May 21, 2025 15:20
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the portfolio balance cards to use Svelte runes, paving the way for a toggle to show/hide balances. Key changes include migrating TokensCardHeader, StakedTokensCard, and HeldTokensCard to use the new Svelte runes syntax with updated prop handling and reactive declarations.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
frontend/src/lib/components/portfolio/TokensCardHeader.svelte Migrates header component to use $props(), $derived, and new snippet rendering for the icon.
frontend/src/lib/components/portfolio/StakedTokensCard.svelte Updates props handling with Svelte runes and replaces slot usage with snippet syntax for the icon.
frontend/src/lib/components/portfolio/HeldTokensCard.svelte Converts props and reactive declarations to Svelte runes syntax and adjusts icon rendering using snippets.

@yhabib yhabib force-pushed the nns1-3721/prework-portfolio branch from 10d9721 to f79c0c4 Compare May 21, 2025 19:15
Copy link
Contributor
@mstrasinskis mstrasinskis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@yhabib yhabib added this pull request to the merge queue May 21, 2025
@yhabib yhabib changed the title refactor(portfolio): migrate balance cards to svelte 5 refactor(portfolio): migrate balance cards to runes May 21, 2025
Merged via the queue into main with commit 9306dd4 May 21, 2025
36 checks passed
@yhabib yhabib deleted the nns1-3721/prework-portfolio branch May 21, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0