-
Notifications
You must be signed in to change notification settings - Fork 66
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
base: subwallet-dev
Are you sure you want to change the base?
Conversation
🚀 Deployed on https://pr-3934--sw-web-runner.netlify.app |
|
||
export interface PopularGroup { | ||
tokens: Record<string, number>, | ||
piority: number |
There was a problem hiding this comment.
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/components/Modal/ReceiveModalNew/parts/TokenSelector.tsx
Outdated
Show resolved
Hide resolved
} | ||
}; | ||
|
||
export const sortByTokenPopularity = (a: string, b: string, aIsPiorityToken: boolean, bIsPiorityToken: boolean, aPiority: number, bPiority: number): number => { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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>]; |
There was a problem hiding this comment.
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() === '') { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recheck spelling
No description provided.