-
Notifications
You must be signed in to change notification settings - Fork 60
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
fix(dashboard): change bridgeId to bridge name #1498
base: develop
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for swapr ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@0xVance Only way to bridge without assets is to use testnets (Rinkeby -> A.Rinkeby) |
src/pages/Account/accountUtils.ts
Outdated
export const mapBridgeIdToDisplayName = (bridgeId: BridgeList) => { | ||
switch (bridgeId) { | ||
case 'arbitrum:mainnet': | ||
case 'arbitrum:testnet': | ||
return 'Arbitrum' | ||
case 'connext': | ||
return 'Connext' | ||
case 'omnibridge:eth-xdai': | ||
return 'Omnibridge' | ||
case 'socket': | ||
return 'Socket' | ||
case 'xdai': | ||
return 'xDai' | ||
} | ||
} |
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.
In this case is better to create a dictionary and map key to value :)
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.
Also maybe we should have a different name for Arbitrum mainnet
and Arbitrum testnet
as it may confuse users.
@@ -18,6 +19,15 @@ const expressions = { | |||
type: new RegExp('^(?<type>[A-Za-z]+)'), | |||
} | |||
|
|||
export const bridgeIdToDisplayNameMap: { [k in BridgeList]: string } = { |
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.
Also, we usually type global constant names with UPPER_CASE convention
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.
Agree here
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.
What @berteotti mentioned, otherwise looks
@@ -18,6 +19,15 @@ const expressions = { | |||
type: new RegExp('^(?<type>[A-Za-z]+)'), | |||
} | |||
|
|||
export const bridgeIdToDisplayNameMap: { [k in BridgeList]: string } = { |
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.
Agree here
fb69230
to
0c5053c
Compare
ff47650
to
b3b3815
Compare
91e4f23
to
af06da1
Compare
Fixes #1453
@niemam29 @MilanVojnovic95 I'm ashamed to ask such question but I can't figure out how to make bridge transactions without spending money - would you be so kind and check if names are displayed properly? I coded them to be: