From 4148903e888527eebbd26a3775b1c2649d3160c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=B3vis=20Neto?= Date: Tue, 17 Sep 2024 14:21:19 +0200 Subject: [PATCH] fix: move error condition to top of the confirmation view component --- .../__snapshots__/SignOrExecute.test.tsx.snap | 83 +++++++++---------- src/components/tx/SignOrExecuteForm/index.tsx | 6 +- 2 files changed, 43 insertions(+), 46 deletions(-) diff --git a/src/components/tx/SignOrExecuteForm/__tests__/__snapshots__/SignOrExecute.test.tsx.snap b/src/components/tx/SignOrExecuteForm/__tests__/__snapshots__/SignOrExecute.test.tsx.snap index 1e6b92d792..72e2173472 100644 --- a/src/components/tx/SignOrExecuteForm/__tests__/__snapshots__/SignOrExecute.test.tsx.snap +++ b/src/components/tx/SignOrExecuteForm/__tests__/__snapshots__/SignOrExecute.test.tsx.snap @@ -263,53 +263,50 @@ exports[`SignOrExecute should display an error screen 1`] = ` class="MuiCardContent-root cardContent css-46bh2p-MuiCardContent-root" >
-
-
-
-
-
- - - - - - - - - + Something went wrong, +
+ please try again. + + +
+
+ + +

+ Error: This is a mock error message +

+

+ SignOrExecuteForm/index +

+ + Go home +
diff --git a/src/components/tx/SignOrExecuteForm/index.tsx b/src/components/tx/SignOrExecuteForm/index.tsx index 419b696157..095ca2e674 100644 --- a/src/components/tx/SignOrExecuteForm/index.tsx +++ b/src/components/tx/SignOrExecuteForm/index.tsx @@ -27,12 +27,12 @@ const SignOrExecute = (props: SignOrExecuteExtendedProps) => { const [txDetails, error, isLoading] = useProposeTx(safeTx, props.txId, props.origin) - return isLoading || !safeTx || !txDetails ? ( - - ) : error ? ( + return error ? ( + ) : isLoading || !safeTx || !txDetails ? ( + ) : ( )