-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathindex.ts
50 lines (43 loc) · 1.47 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import { LitElement, html } from 'lit'
import { ifDefined } from 'lit/directives/if-defined.js'
import { AssetUtil, EventsController, RouterController } from '@reown/appkit-controllers'
import { customElement } from '@reown/appkit-ui'
@customElement('w3m-connecting-wc-unsupported')
export class W3mConnectingWcUnsupported extends LitElement {
// -- Members ------------------------------------------- //
private readonly wallet = RouterController.state.data?.wallet
public constructor() {
super()
if (!this.wallet) {
throw new Error('w3m-connecting-wc-unsupported: No wallet provided')
}
EventsController.sendEvent({
type: 'track',
event: 'SELECT_WALLET',
properties: { name: this.wallet.name, platform: 'browser' }
})
}
// -- Render -------------------------------------------- //
public override render() {
return html`
<wui-flex
flexDirection="column"
alignItems="center"
.padding=${['3xl', 'xl', 'xl', 'xl'] as const}
gap="xl"
>
<wui-wallet-image
size="lg"
imageSrc=${ifDefined(AssetUtil.getWalletImage(this.wallet))}
></wui-wallet-image>
<wui-text variant="paragraph-500" color="fg-100">Not Detected</wui-text>
</wui-flex>
<w3m-mobile-download-links .wallet=${this.wallet}></w3m-mobile-download-links>
`
}
}
declare global {
interface HTMLElementTagNameMap {
'w3m-connecting-wc-unsupported': W3mConnectingWcUnsupported
}
}