Skip to content

Commit

Permalink
fix: update link behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
janniks committed Feb 12, 2024
1 parent fd1207f commit 47a96b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
14 changes: 7 additions & 7 deletions packages/connect-ui/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ export class Modal {
return provider.iOSAppStoreUrl ?? provider.googlePlayStoreUrl;
}

getInstallUrl(provider: WebBTCProvider, browser: string) {
if (browser === 'Chrome') {
getInstallUrl(provider: WebBTCProvider, browser: string, platform: string) {
if (platform === 'IOS') {
return provider.iOSAppStoreUrl ?? this.getBrowserUrl(provider) ?? provider.webUrl;
} else if (browser === 'Chrome') {
return provider.chromeWebStoreUrl ?? this.getMobileUrl(provider) ?? provider.webUrl;
} else if (browser === 'Firefox') {
return provider.mozillaAddOnsUrl ?? this.getMobileUrl(provider) ?? provider.webUrl;
} else if (browser === 'IOS') {
return provider.iOSAppStoreUrl ?? this.getBrowserUrl(provider) ?? provider.webUrl;
} else if (browser === 'Android') {
} else if (platform === 'Android') {
return provider.googlePlayStoreUrl ?? this.getBrowserUrl(provider) ?? provider.webUrl;
} else {
return this.getBrowserUrl(provider) ?? provider.webUrl ?? this.getMobileUrl(provider);
Expand Down Expand Up @@ -197,10 +197,10 @@ export class Modal {
</a>
)}
</div>
{this.getInstallUrl(provider, browser) && (
{this.getInstallUrl(provider, browser, mobile) && (
<a
class="rounded-[10px] border border-[#EFEFF2] px-4 py-2 text-sm font-medium shadow-[0_1px_2px_0_#0000000A] outline-[#FFBD7A] transition-colors hover:text-[#242629] hover:shadow-[0_1px_2px_0_#00000010] focus:outline focus:outline-[3px] active:scale-95"
href={this.getInstallUrl(provider, browser)}
href={this.getInstallUrl(provider, browser, mobile)}
rel="noopener noreferrer"
target="_blank"
>
Expand Down
5 changes: 2 additions & 3 deletions packages/connect/src/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ export const DEFAULT_PROVIDERS: WebBTCProvider[] = [
webUrl: 'https://leather.io',
chromeWebStoreUrl:
'https://chrome.google.com/webstore/detail/hiro-wallet/ldinpeekobnhjjdofggfgjlcehhmanlj',
mozillaAddOnsUrl: 'https://addons.mozilla.org/en-US/firefox/addon/hiro-wallet',
googlePlayStoreUrl: 'https://play.google.com/store/apps/details?id=io.hiro.wallet',
iOSAppStoreUrl: 'https://apps.apple.com/app/hiro-wallet/id1492380872',
mozillaAddOnsUrl: 'https://leather.io/install-extension',
},
{
id: 'XverseProviders.StacksProvider',
Expand All @@ -23,6 +21,7 @@ export const DEFAULT_PROVIDERS: WebBTCProvider[] = [
'https://chrome.google.com/webstore/detail/xverse-wallet/idnnbdplmphpflfnlkomgpfbpcgelopg',
googlePlayStoreUrl: 'https://play.google.com/store/apps/details?id=com.secretkeylabs.xverse',
iOSAppStoreUrl: 'https://apps.apple.com/app/xverse-bitcoin-web3-wallet/id1552272513',
mozillaAddOnsUrl: 'https://www.xverse.app/download',
},
{
id: 'AsignaProvider',
Expand Down

0 comments on commit 47a96b0

Please sign in to comment.