From 80868354939d95e419b35a15a7add93de0449445 Mon Sep 17 00:00:00 2001 From: xiaodino Date: Tue, 19 Sep 2023 23:52:31 -0700 Subject: [PATCH 1/2] fix(bridge-ui-v2): update InsufficientFunds dialog in mobile view --- .../src/components/Transactions/MobileDetailsDialog.svelte | 2 +- .../bridge-ui-v2/src/components/Transactions/Status.svelte | 6 +++++- .../src/components/Transactions/Transaction.svelte | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/bridge-ui-v2/src/components/Transactions/MobileDetailsDialog.svelte b/packages/bridge-ui-v2/src/components/Transactions/MobileDetailsDialog.svelte index b83f002d4ac..e746ef00949 100644 --- a/packages/bridge-ui-v2/src/components/Transactions/MobileDetailsDialog.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/MobileDetailsDialog.svelte @@ -66,7 +66,7 @@
- +
  • diff --git a/packages/bridge-ui-v2/src/components/Transactions/Status.svelte b/packages/bridge-ui-v2/src/components/Transactions/Status.svelte index 8b5e370c9c7..f0857963435 100644 --- a/packages/bridge-ui-v2/src/components/Transactions/Status.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/Status.svelte @@ -36,6 +36,8 @@ const log = getLogger('components:Status'); export let bridgeTx: BridgeTransaction; + export let isDesktopOrLarger: boolean; + export let isMobileDetailsDialog: boolean; let polling: ReturnType; @@ -140,7 +142,9 @@ warningToast($t('transactions.actions.claim.rejected')); break; case err instanceof InsufficientBalanceError: - modalOpen = true; + if (isDesktopOrLarger || isMobileDetailsDialog) { + modalOpen = true; + } break; case err instanceof InvalidProofError: errorToast($t('TODO: InvalidProofError')); diff --git a/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte b/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte index 6a12fac7350..4c373f8c542 100644 --- a/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte @@ -65,7 +65,7 @@ {/if}
    - +
    - +
  • diff --git a/packages/bridge-ui-v2/src/components/Transactions/Status.svelte b/packages/bridge-ui-v2/src/components/Transactions/Status.svelte index f0857963435..f95b7bd4976 100644 --- a/packages/bridge-ui-v2/src/components/Transactions/Status.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/Status.svelte @@ -5,6 +5,7 @@ import { parseEther, UserRejectedRequestError } from 'viem'; import { chainConfig } from '$chainConfig'; + import { DesktopOrLarger } from '$components/DesktopOrLarger'; import { errorToast, infoToast, @@ -36,8 +37,7 @@ const log = getLogger('components:Status'); export let bridgeTx: BridgeTransaction; - export let isDesktopOrLarger: boolean; - export let isMobileDetailsDialog: boolean; + export let isFromMobileDetailsDialog: boolean; let polling: ReturnType; @@ -45,6 +45,8 @@ let processable = false; // bridge tx state to be processed: claimed/retried/released let bridgeTxStatus: Maybe; + let isDesktopOrLarger = false; + let modalOpen = false; // TODO: enum? @@ -142,7 +144,7 @@ warningToast($t('transactions.actions.claim.rejected')); break; case err instanceof InsufficientBalanceError: - if (isDesktopOrLarger || isMobileDetailsDialog) { + if (isDesktopOrLarger || isFromMobileDetailsDialog) { modalOpen = true; } break; @@ -299,3 +301,5 @@ + + diff --git a/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte b/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte index 4c373f8c542..266d18c9b59 100644 --- a/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte +++ b/packages/bridge-ui-v2/src/components/Transactions/Transaction.svelte @@ -65,7 +65,7 @@ {/if}
    - +