Skip to content
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

[Issue-3920] Show well-known tokens on top #3934

Open
wants to merge 13 commits into
base: subwallet-dev
Choose a base branch
from

Conversation

PDTnhah
Copy link

@PDTnhah PDTnhah commented Dec 18, 2024

No description provided.

@PDTnhah PDTnhah added this to the Milestone 8 milestone Dec 18, 2024
@PDTnhah PDTnhah requested review from S2kael and nampc1 December 18, 2024 09:02
@PDTnhah PDTnhah self-assigned this Dec 18, 2024
@PDTnhah PDTnhah linked an issue Dec 18, 2024 that may be closed by this pull request
@saltict
Copy link

saltict commented Dec 18, 2024

🚀 Deployed on https://pr-3934--sw-web-runner.netlify.app

@saltict saltict temporarily deployed to pull request December 18, 2024 09:25 Inactive
@saltict saltict temporarily deployed to pull request December 19, 2024 10:46 Inactive
@PDTnhah PDTnhah requested a review from lw-cdm December 31, 2024 12:17
@saltict saltict temporarily deployed to pull request December 31, 2024 12:25 Inactive

export interface PopularGroup {
tokens: Record<string, number>,
piority: number
Copy link

Choose a reason for hiding this comment

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

wrong spelling

packages/extension-koni-ui/src/contexts/DataContext.tsx Outdated Show resolved Hide resolved
packages/extension-koni-ui/src/utils/sort/token.ts Outdated Show resolved Hide resolved
@saltict saltict temporarily deployed to pull request January 6, 2025 02:07 Inactive
}
};

export const sortByTokenPopularity = (a: string, b: string, aIsPiorityToken: boolean, bIsPiorityToken: boolean, aPiority: number, bPiority: number): number => {
Copy link

Choose a reason for hiding this comment

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

recheck spelling (Piority -> Priority)


export const sortTokenByValue = (a: TokenBalanceItemType, b: TokenBalanceItemType): number => {
const convertValue = b.total.convertedValue.minus(a.total.convertedValue).toNumber();
export interface TokenSort {
Copy link

Choose a reason for hiding this comment

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

Rename the type to make them more meaningful and grammatically correct

@@ -1709,6 +1709,13 @@ export interface RequestAddPspToken {
};
}

// Popular tokens

export interface PopularGroup {
Copy link

Choose a reason for hiding this comment

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

Rename the type to make them more meaningful and grammatically correct

/* Ledger */

/* Popular tokens */
'pri(popular.tokens)': [null, Record<string, PopularGroup>, Record<string, PopularGroup>];
Copy link

Choose a reason for hiding this comment

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

Rename the type

@@ -51,10 +54,12 @@ function Component ({ className = '', items, onCancel, onSelectItem }: Props): R
}

return filteredList;
} else if (currentSearchText.toLowerCase() === '') {
Copy link

Choose a reason for hiding this comment

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

Recheck this logic

const aHasBalance = (a.total && a.total.convertedValue.toNumber() !== 0) || (a.total && a.total.value.toNumber() !== 0);
const bHasBalance = (b.total && b.total.convertedValue.toNumber() !== 0) || (b.total && b.total.value.toNumber() !== 0);

const aPiority = a.multiChainAsset ? aIsPiorityToken ? (popularTokens[a.multiChainAsset].tokens)[a.slug] : 0 : aIsPiorityToken ? popularTokens[a.slug].piority : 0;
Copy link

Choose a reason for hiding this comment

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

Recheck spelling

@saltict saltict temporarily deployed to pull request January 6, 2025 11:08 Inactive
@saltict saltict temporarily deployed to pull request January 7, 2025 08:40 Inactive
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.

Show well-known tokens on top
5 participants