From 2e50b131d1a5744752f7bc09992cf8bf7488fe36 Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Fri, 27 Dec 2024 11:26:12 +0300 Subject: [PATCH] Rebase --- .../transactions/TxDetails/TxNote.tsx | 44 + .../transactions/TxDetails/index.tsx | 3 + .../transactions/TxSummary/styles.module.css | 6 +- .../tx/SignOrExecuteForm/TxNoteForm.tsx | 2102 +++++++++++++++++ 4 files changed, 2152 insertions(+), 3 deletions(-) create mode 100644 apps/web/src/components/transactions/TxDetails/TxNote.tsx create mode 100644 apps/web/src/components/tx/SignOrExecuteForm/TxNoteForm.tsx diff --git a/apps/web/src/components/transactions/TxDetails/TxNote.tsx b/apps/web/src/components/transactions/TxDetails/TxNote.tsx new file mode 100644 index 0000000000..9d7d317737 --- /dev/null +++ b/apps/web/src/components/transactions/TxDetails/TxNote.tsx @@ -0,0 +1,44 @@ +import { DataRow } from '@/components/common/Table/DataRow' +import useAsync from '@/hooks/useAsync' +import { useCurrentChain } from '@/hooks/useChains' +import { isMultisigDetailedExecutionInfo } from '@/utils/transaction-guards' +import { Box, Divider } from '@mui/material' +import type { TransactionDetails } from '@safe-global/safe-gateway-typescript-sdk' + +const TxNote = ({ txDetails }: { txDetails: TransactionDetails }) => { + const currentChain = useCurrentChain() + const txService = currentChain?.transactionService + + let safeTxHash = '' + if (isMultisigDetailedExecutionInfo(txDetails.detailedExecutionInfo)) { + safeTxHash = txDetails.detailedExecutionInfo?.safeTxHash + } + + const [data] = useAsync(() => { + if (!safeTxHash || !txService) return + return fetch(`${txService}/api/v1/multisig-transactions/${safeTxHash}`).then((res) => res.json()) + }, [safeTxHash, txService]) + + let note = '' + if (data) { + try { + const origin = JSON.parse(data.origin) + const parsedName = JSON.parse(origin.name) + note = parsedName.note + } catch { + // Ignore, no note + } + } + + return note ? ( + <> + + {note} + + + + + ) : null +} + +export default TxNote diff --git a/apps/web/src/components/transactions/TxDetails/index.tsx b/apps/web/src/components/transactions/TxDetails/index.tsx index 412df2815d..ac3211fe00 100644 --- a/apps/web/src/components/transactions/TxDetails/index.tsx +++ b/apps/web/src/components/transactions/TxDetails/index.tsx @@ -36,6 +36,7 @@ import { FEATURES } from '@/utils/chains' import { useGetTransactionDetailsQuery } from '@/store/api/gateway' import { asError } from '@/services/exceptions/utils' import { POLLING_INTERVAL } from '@/config/constants' +import TxNote from './TxNote' export const NOT_AVAILABLE = 'n/a' @@ -82,6 +83,8 @@ const TxDetailsBlock = ({ txSummary, txDetails }: TxDetailsProps): ReactElement <> {/* /Details */}
+ +
diff --git a/apps/web/src/components/transactions/TxSummary/styles.module.css b/apps/web/src/components/transactions/TxSummary/styles.module.css index fc8ed69fac..b063e24932 100644 --- a/apps/web/src/components/transactions/TxSummary/styles.module.css +++ b/apps/web/src/components/transactions/TxSummary/styles.module.css @@ -29,9 +29,9 @@ } .gridContainer.conflictGroup { - grid-template-columns: var(--grid-type) var(--grid-info) var(--grid-date) var(--grid-confirmations) var(--grid-status) var( - --grid-actions - ); + grid-template-columns: var(--grid-type) var(--grid-info) var(--grid-date) var(--grid-confirmations) var( + --grid-status + ) var(--grid-actions); grid-template-areas: 'type info date confirmations status actions'; } diff --git a/apps/web/src/components/tx/SignOrExecuteForm/TxNoteForm.tsx b/apps/web/src/components/tx/SignOrExecuteForm/TxNoteForm.tsx new file mode 100644 index 0000000000..937875ec7c --- /dev/null +++ b/apps/web/src/components/tx/SignOrExecuteForm/TxNoteForm.tsx @@ -0,0 +1,2102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + safe-wallet-monorepo/src/components/tx/SignOrExecuteForm/TxNoteForm.tsx at 96a16849b3a17a843a0b18e5e0f73475af82af93 · safe-global/safe-wallet-monorepo · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ Skip to content + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + +
+ +
+ + + + + + + + +
+ + + + + +
+ + + + + + + + + +
+
+
+ + + + + + + + + + + + +
+ +
+ +
+ +
+ + + + / + + safe-wallet-monorepo + + + Public +
+ + +
+ +
+ + +
+
+ +
+
+ + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + +

Latest commit

 

History

History
39 lines (33 loc) · 1.23 KB

File metadata and controls

39 lines (33 loc) · 1.23 KB
+
+ + + + +
+ +
+ +
+
+ +
+ +
+

Footer

+ + + + +
+
+ + + + + © 2024 GitHub, Inc. + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+ + +