|
1 | 1 | <script lang="ts"> |
2 | | - import { StoreVersion } from "../../../types/modal" |
| 2 | + import type { WalletProvider } from "@starknet-io/get-starknet-core" |
| 3 | + import type { StoreVersion } from "../../../types/modal" |
3 | 4 |
|
4 | 5 | import AppleIcon from "../../components/icons/brands/AppleIcon.svelte" |
5 | 6 | import PlayStore from "../../components/icons/brands/PlayStore.svelte" |
|
16 | 17 | import HorizontalLine from "../../components/HorizontalLine.svelte" |
17 | 18 |
|
18 | 19 | export let isArgent: boolean = false |
| 20 | + export let extensionId: string = "" |
19 | 21 | export let extensionName: string = "" |
20 | 22 | export let store: StoreVersion | null |
21 | 23 | export let storeLink: string | undefined |
| 24 | + export let discoveryWallets: WalletProvider[] |
| 25 | +
|
| 26 | + const discoveredWallet = discoveryWallets.find((w: WalletProvider) => w.id.toLowerCase() === extensionId.toLowerCase()) |
| 27 | + const discoveredWalletDownloads = Object.entries(discoveredWallet?.downloads || {}) |
22 | 28 |
|
23 | 29 | const storeData = { |
24 | 30 | // @dev - Be mindful of name property length, it might break the UI |
|
39 | 45 |
|
40 | 46 | <section class="flex flex-col flex-grow justify-between"> |
41 | 47 | <div class="flex flex-col gap-2"> |
| 48 | + <!-- Upon removal of Argent mobile, remove and code else `!isArgent` if case from line 84 --> |
42 | 49 | {#if isArgent} |
43 | 50 | <ArgentDownloadItem |
44 | 51 | title="Ready mobile" |
|
80 | 87 | {/if} |
81 | 88 | </svelte:fragment> |
82 | 89 | </ArgentDownloadItem> |
| 90 | + {:else if !isArgent} |
| 91 | + <p class="text-[16px] text-primary"> |
| 92 | + <span class="capitalize">{extensionName}</span> is not available on your browser.<br/><br/> |
| 93 | + {#if discoveredWalletDownloads.length > 0} |
| 94 | + Try on other browsers:{" "} |
| 95 | + {#each discoveredWalletDownloads as discovery, i} |
| 96 | + <Link as="a" className="capitalize" href={discovery[1]}>{discovery[0]}</Link>{i + 1 === discoveredWalletDownloads.length ? "." : ", "} |
| 97 | + {/each} |
| 98 | + {/if} |
| 99 | + </p> |
83 | 100 | {/if} |
84 | 101 | </div> |
85 | 102 |
|
|
0 commit comments