From 23b3fef02e161d96fb3a0a0fca6663abea829676 Mon Sep 17 00:00:00 2001 From: Dawid Sowa Date: Wed, 24 Apr 2024 18:02:25 +0200 Subject: [PATCH 1/3] fix: mobile display --- .../src/components/connect-button.ts | 14 +++++++++++++- .../src/components/pages/requests.ts | 2 +- .../src/components/popover/popover.ts | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/connect-button/src/components/connect-button.ts b/packages/connect-button/src/components/connect-button.ts index b967799c..dafff66b 100644 --- a/packages/connect-button/src/components/connect-button.ts +++ b/packages/connect-button/src/components/connect-button.ts @@ -100,6 +100,7 @@ export class ConnectButton extends LitElement { } pristine = true + initialBodyOverflow: string windowClickEventHandler: (event: MouseEvent) => void @@ -119,6 +120,7 @@ export class ConnectButton extends LitElement { constructor() { super() + this.initialBodyOverflow = document.body.style.overflow this.injectFontCSS() this.windowClickEventHandler = (event) => { if (!this.showPopoverMenu) return @@ -170,13 +172,23 @@ export class ConnectButton extends LitElement { private togglePopoverMenu() { this.pristine = false this.showPopoverMenu = !this.showPopoverMenu - if (this.showPopoverMenu) + this.toggleBodyOverflow() + if (this.showPopoverMenu) { this.dispatchEvent( new CustomEvent('onShowPopover', { bubbles: true, composed: true, }), ) + } + } + + private toggleBodyOverflow() { + if (!this.isMobile) return + document.body.style.overflow = + this.showPopoverMenu && this.isMobile + ? 'hidden' + : this.initialBodyOverflow } private closePopover() { diff --git a/packages/connect-button/src/components/pages/requests.ts b/packages/connect-button/src/components/pages/requests.ts index 4f54aee7..e0b825d4 100644 --- a/packages/connect-button/src/components/pages/requests.ts +++ b/packages/connect-button/src/components/pages/requests.ts @@ -67,7 +67,7 @@ export class RadixRequestsPage extends LitElement { .content { padding-bottom: 25px; - max-height: calc(100vh - 180px); + max-height: calc(100vh - 270px); } @media (min-height: 580px) { diff --git a/packages/connect-button/src/components/popover/popover.ts b/packages/connect-button/src/components/popover/popover.ts index b53f7ffd..20e7e3ed 100644 --- a/packages/connect-button/src/components/popover/popover.ts +++ b/packages/connect-button/src/components/popover/popover.ts @@ -81,6 +81,7 @@ export class RadixPopover extends LitElement { :host([isMobile]) { max-width: 100%; + max-height: calc(100% - 5px); } #radix-popover-content { From c2899a2ea2aa65f0ced64a05de6ce822c00296a1 Mon Sep 17 00:00:00 2001 From: Dawid Sowa Date: Wed, 24 Apr 2024 18:20:16 +0200 Subject: [PATCH 2/3] fix: stop failing transactions for a brief moment [RC-168] --- packages/dapp-toolkit/src/wallet-request/wallet-request.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/dapp-toolkit/src/wallet-request/wallet-request.ts b/packages/dapp-toolkit/src/wallet-request/wallet-request.ts index 0eee9ab4..4340ab70 100644 --- a/packages/dapp-toolkit/src/wallet-request/wallet-request.ts +++ b/packages/dapp-toolkit/src/wallet-request/wallet-request.ts @@ -216,10 +216,7 @@ export const WalletRequestClient = (input: { }) } - return requestItemClient.updateStatus({ - id: walletInteractionResponse.interactionId, - status: 'fail', - }) + return okAsync(undefined) } const sendDataRequest = (walletInteraction: WalletInteraction) => { From 7b13286aebb8a52b9de85023a101bef25e63a34e Mon Sep 17 00:00:00 2001 From: Dawid Sowa Date: Wed, 24 Apr 2024 18:26:23 +0200 Subject: [PATCH 3/3] fix: button status when user rejected tx [RC-171] --- packages/dapp-toolkit/src/wallet-request/wallet-request.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/dapp-toolkit/src/wallet-request/wallet-request.ts b/packages/dapp-toolkit/src/wallet-request/wallet-request.ts index 4340ab70..2b677a51 100644 --- a/packages/dapp-toolkit/src/wallet-request/wallet-request.ts +++ b/packages/dapp-toolkit/src/wallet-request/wallet-request.ts @@ -473,6 +473,7 @@ export const WalletRequestClient = (input: { status: 'fail', error: response.error, }) + interactionStatusChangeSubject.next('fail') logger?.debug({ method: 'sendTransaction.errorResponse', response }) return response })