Skip to content

Commit

Permalink
fix: list item divider (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
tien authored Sep 13, 2024
1 parent 2cefdde commit 5694cb2
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions packages/dot-connect/src/elements/connection-dialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import "./components/qr-code.js";
import { computed, effect, signal } from "@lit-labs/preact-signals";
import { connectWallet, disconnectWallet } from "@reactive-dot/core";
import { DeepLinkWallet, InjectedWallet } from "@reactive-dot/core/wallets.js";
import { css, html } from "lit";
import { css, html, nothing } from "lit";
import { customElement, property } from "lit/decorators.js";
import { classMap } from "lit/directives/class-map.js";
import { join } from "lit/directives/join.js";
Expand Down Expand Up @@ -108,21 +108,22 @@ export class ConnectionDialog extends DotConnectElement {
<header><h3>Popular</h3></header>
<ul>
${join(
this.#nonInstalledWallets.value.map(
(wallet) =>
html`<dc-downloadable-wallet
.wallet=${wallet}
></dc-downloadable-wallet>`,
),
html`<hr />`,
)}
${join(
this.#deepLinkWallets.value.map(
(wallet) =>
html`<dc-deep-link-wallet
.wallet=${wallet}
></dc-deep-link-wallet>`,
),
[
...this.#nonInstalledWallets.value
.filter(DownloadableWallet.shouldRender)
.map(
(wallet) =>
html`<dc-downloadable-wallet
.wallet=${wallet}
></dc-downloadable-wallet>`,
),
...this.#deepLinkWallets.value.map(
(wallet) =>
html`<dc-deep-link-wallet
.wallet=${wallet}
></dc-deep-link-wallet>`,
),
],
html`<hr />`,
)}
</ul>
Expand Down Expand Up @@ -338,6 +339,11 @@ export class DownloadableWallet extends DotConnectElement {
@property({ attribute: false })
wallet!: InjectedWalletInfo;

// TODO: this is a hack
static shouldRender(wallet: InjectedWalletInfo) {
return getDownloadUrl(wallet) !== undefined;
}

get #downloadUrl() {
return getDownloadUrl(this.wallet);
}
Expand All @@ -353,7 +359,7 @@ export class DownloadableWallet extends DotConnectElement {

protected override render() {
if (this.#downloadUrl === undefined) {
return;
return nothing;
}

const isMobile =
Expand Down

0 comments on commit 5694cb2

Please sign in to comment.