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

fix(dashboard): change bridgeId to bridge name #1498

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

0xVance
Copy link
Contributor

@0xVance 0xVance commented Sep 19, 2022

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:
image

@netlify
Copy link

netlify bot commented Sep 19, 2022

Deploy Preview for swapr ready!

Name Link
🔨 Latest commit 4c67cc0
🔍 Latest deploy log https://app.netlify.com/sites/swapr/deploys/632a36cf5801ec0009a0b63e
😎 Deploy Preview https://deploy-preview-1498--swapr.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot temporarily deployed to fix-1453-improve-bridge-info September 19, 2022 22:49 Destroyed
@niemam29
Copy link
Contributor

niemam29 commented Sep 20, 2022

@0xVance Only way to bridge without assets is to use testnets (Rinkeby -> A.Rinkeby)
It looks good to me but it would be nice if someone with more assets could tests that because i got real assets just to test socket

Comment on lines 22 to 36
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'
}
}
Copy link
Collaborator

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 :)

Copy link
Collaborator

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 } = {
Copy link
Collaborator

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree here

Copy link
Contributor

@adamazad adamazad left a 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 } = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree here

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.

User dashboard: bridge info improvement
5 participants