Skip to content

Commit

Permalink
Merge pull request #184 from radixdlt/RC-167
Browse files Browse the repository at this point in the history
fix: ux issues
  • Loading branch information
dawidsowardx authored May 7, 2024
2 parents 66f68af + 7b13286 commit 1c68c5c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
14 changes: 13 additions & 1 deletion packages/connect-button/src/components/connect-button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export class ConnectButton extends LitElement {
}

pristine = true
initialBodyOverflow: string

windowClickEventHandler: (event: MouseEvent) => void

Expand All @@ -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
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion packages/connect-button/src/components/pages/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions packages/connect-button/src/components/popover/popover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ export class RadixPopover extends LitElement {
:host([isMobile]) {
max-width: 100%;
max-height: calc(100% - 5px);
}
#radix-popover-content {
Expand Down
6 changes: 2 additions & 4 deletions packages/dapp-toolkit/src/wallet-request/wallet-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,7 @@ export const WalletRequestClient = (input: {
})
}

return requestItemClient.updateStatus({
id: walletInteractionResponse.interactionId,
status: 'fail',
})
return okAsync(undefined)
}

const sendDataRequest = (walletInteraction: WalletInteraction) => {
Expand Down Expand Up @@ -476,6 +473,7 @@ export const WalletRequestClient = (input: {
status: 'fail',
error: response.error,
})
interactionStatusChangeSubject.next('fail')
logger?.debug({ method: 'sendTransaction.errorResponse', response })
return response
})
Expand Down

0 comments on commit 1c68c5c

Please sign in to comment.