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

Links for wallets #2265

Merged
merged 3 commits into from
Jul 10, 2024
Merged

Links for wallets #2265

merged 3 commits into from
Jul 10, 2024

Conversation

kattylucy
Copy link
Collaborator

@kattylucy kattylucy commented Jul 4, 2024

  • Show non-support banner regardless if user wallet is connected. Do not show the banner if browser is chrome/firefox
  • Links to firefox store shall be different than the url for chrome store. Unfortunately '@subwallet/wallet-connect/types' only returns walletUrl for chrome only, some hard code links was required to make it work on firefox.

#1838

  • [ x ] Dev
  • Dev
  • Designer
  • Product

Copy link

github-actions bot commented Jul 4, 2024

PR deployed in Google Cloud
URL: https://app-pr2265.k-f.dev
Commit #: c7521ea
To access the functions directly check the corresponding deploy Action

Copy link

github-actions bot commented Jul 4, 2024

PR deployed in Google Cloud
URL: https://pr2265-app-ff-production.k-f.dev
Commit #: c7521ea
To access the functions directly check the corresponding deploy Action

@@ -128,6 +129,7 @@ export function getEvmConnectors(
get shown() {
return !isMobile() || this.installed
},
extensionName: 'metamask'
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not use the existing id for this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was just for consistency with the object we get from wallets but can def use ID

Copy link
Collaborator

Choose a reason for hiding this comment

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

mainly saying it because the typing isn't quite right now, as it's casting to EvmConnectorMeta, but not all connectors have the extensionName. I'd prefer using id and then doing a check for it in getAdjustedInstallUrl

@kattylucy kattylucy force-pushed the links_for_wallets branch 2 times, most recently from 69438ae to 58eb536 Compare July 9, 2024 13:54
@kattylucy kattylucy requested a review from onnovisser July 9, 2024 13:54
@@ -26,6 +26,7 @@ export type EvmConnectorMeta = {
id: string
title: string
installUrl: string
extensionName: string
Copy link
Collaborator

Choose a reason for hiding this comment

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

leftover extensionName

Comment on lines 52 to 66
const getAdjustedInstallUrl = (wallet: { extensionName: string; installUrl: string }): string => {
const browser = getSupportedBrowser()
const { extensionName, installUrl } = wallet
if (browser === 'firefox') {
return `https://addons.mozilla.org/en-US/firefox/addon/${walletsList[extensionName || 'metamask']}/`
} else {
return installUrl
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const getAdjustedInstallUrl = (wallet: { extensionName: string; installUrl: string }): string => {
const browser = getSupportedBrowser()
const { extensionName, installUrl } = wallet
if (browser === 'firefox') {
return `https://addons.mozilla.org/en-US/firefox/addon/${walletsList[extensionName || 'metamask']}/`
} else {
return installUrl
}
}
function getAdjustedInstallUrl(wallet: Wallet | EvmConnectorMeta): string {
const browser = getSupportedBrowser()
if (browser === 'firefox') {
return `https://addons.mozilla.org/en-US/firefox/addon/${walletsList['extensionName' in wallet ? wallet.extensionName : 'metamask']}/`
} else {
return wallet.installUrl
}
}

@kattylucy kattylucy force-pushed the links_for_wallets branch 3 times, most recently from 71533a6 to 7ee8bab Compare July 10, 2024 13:22
Show non-supported banner regardless if user wallet is connected or not
@kattylucy kattylucy merged commit 8d8f2e7 into main Jul 10, 2024
13 checks passed
@kattylucy kattylucy deleted the links_for_wallets branch July 10, 2024 14:18
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