From dd2a048095e2fec0e6d37f58cc519ba89ed11e76 Mon Sep 17 00:00:00 2001 From: MK Date: Thu, 7 Nov 2024 17:36:41 +0000 Subject: [PATCH] chore: tweak --- .../w3m-connect-external-widget/index.ts | 1 + .../src/views/w3m-connect-view/index.ts | 25 +++---------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/packages/scaffold-ui/src/partials/w3m-connect-external-widget/index.ts b/packages/scaffold-ui/src/partials/w3m-connect-external-widget/index.ts index d19f1ff5bf..7ec2d75b24 100644 --- a/packages/scaffold-ui/src/partials/w3m-connect-external-widget/index.ts +++ b/packages/scaffold-ui/src/partials/w3m-connect-external-widget/index.ts @@ -49,6 +49,7 @@ export class W3mConnectExternalWidget extends LitElement { name=${connector.name ?? 'Unknown'} data-testid=${`wallet-selector-external-${connector.id}`} @click=${() => this.onConnector(connector)} + tabIdx=${ifDefined(this.tabIdx)} > ` diff --git a/packages/scaffold-ui/src/views/w3m-connect-view/index.ts b/packages/scaffold-ui/src/views/w3m-connect-view/index.ts index 80f23428e1..a96f692a54 100644 --- a/packages/scaffold-ui/src/views/w3m-connect-view/index.ts +++ b/packages/scaffold-ui/src/views/w3m-connect-view/index.ts @@ -96,30 +96,21 @@ export class W3mConnectView extends LitElement { tabIdx=${ifDefined(tabIndex)} > - ${this.walletListTemplate()} + ${this.walletListTemplate(tabIndex)} - ${this.guideTemplate()} + ${this.guideTemplate(disabled)} ` } // -- Private ------------------------------------------- // - private walletListTemplate() { - const { termsConditionsUrl, privacyPolicyUrl, enableLegalCheckbox } = OptionsController.state + private walletListTemplate(tabIndex?: number) { const socials = this.features?.socials const emailShowWallets = this.features?.emailShowWallets const enableWallets = OptionsController.state.enableWallets - const legalUrl = termsConditionsUrl || privacyPolicyUrl - const showLegalCheckbox = - Boolean(legalUrl) && Boolean(enableLegalCheckbox) && this.walletGuide === 'get-started' - - const disabled = showLegalCheckbox && !this.checked - - const tabIndex = disabled ? -1 : undefined - if (!enableWallets) { return null } @@ -154,20 +145,12 @@ export class W3mConnectView extends LitElement { return html`` } - private guideTemplate() { + private guideTemplate(disabled = false) { const socials = this.features?.socials const enableWallets = OptionsController.state.enableWallets - const { termsConditionsUrl, privacyPolicyUrl, enableLegalCheckbox } = OptionsController.state - - const legalUrl = termsConditionsUrl || privacyPolicyUrl - const showLegalCheckbox = - Boolean(legalUrl) && Boolean(enableLegalCheckbox) && this.walletGuide === 'get-started' - const socialsExist = socials && socials.length - const disabled = showLegalCheckbox && !this.checked - const classes = { guide: true, disabled