From e2ed93f1a0a09547a93de2249a8607d66e92df93 Mon Sep 17 00:00:00 2001 From: Maxwell Lasky Date: Thu, 27 Jan 2022 11:55:15 -0700 Subject: [PATCH] hotfix: fix activity defects (#2378) * Fixes numerous defects associated with activity tab * Bump version * lint * Fix pending count styles on legacy --- .../__snapshots__/Settings.test.js.snap | 2 +- app/actions/pendingTransactionActions.js | 14 +--- .../Transaction/N3PendingAbstract.jsx | 84 +++++++++++++++++++ .../Blockchain/Transaction/Transaction.jsx | 23 ++++- .../Send/SendPanel/SendSuccess/index.jsx | 1 + app/containers/App/Sidebar/Sidebar.jsx | 8 +- app/containers/App/Sidebar/Sidebar.scss | 20 ++++- package.json | 2 +- 8 files changed, 135 insertions(+), 19 deletions(-) create mode 100644 app/components/Blockchain/Transaction/N3PendingAbstract.jsx diff --git a/__tests__/components/__snapshots__/Settings.test.js.snap b/__tests__/components/__snapshots__/Settings.test.js.snap index 02e5114cf..a17aa049b 100644 --- a/__tests__/components/__snapshots__/Settings.test.js.snap +++ b/__tests__/components/__snapshots__/Settings.test.js.snap @@ -923,7 +923,7 @@ exports[`Settings renders without crashing 1`] = ` Manage your neon wallet - v - 2.12.3 + 2.12.4
React$Node | null, + asset: { + symbol: string, + image?: string, + }, + blocktime: number, + amount: string | number, + to: string, + confirmations: number, + + renderTxDate: (time: number) => React$Node | null, +} + +class N3PendingAbstract extends React.Component { + render = () => { + const { + asset, + amount, + to, + blocktime, + findContact, + confirmations, + renderTxDate, + } = this.props + const contactTo = findContact(to) + const logo = asset.image && ( + {`${asset.symbol} + ) + + return ( + +
+
+
+
+ +
+
+ {!blocktime ? ( +
+ awaiting confirmations... +
+ ) : ( + renderTxDate(blocktime) + )} +
Transfer
+
+ +
+
+
+ {logo} + {asset.symbol} +
+
{amount}
+
+
+

{contactTo}

+
+
+
+ {confirmations || 0}{' '} + {pluralize('Confirmation', confirmations || 0)} +
+
+
+ ) + } +} + +export default injectIntl(N3PendingAbstract) diff --git a/app/components/Blockchain/Transaction/Transaction.jsx b/app/components/Blockchain/Transaction/Transaction.jsx index 94f5fa82d..1361a0bd4 100644 --- a/app/components/Blockchain/Transaction/Transaction.jsx +++ b/app/components/Blockchain/Transaction/Transaction.jsx @@ -22,6 +22,7 @@ import Tooltip from '../../Tooltip' import styles from './Transaction.scss' import N3NEP11ReceiveAbstract from './N3NEP11ReceiveAbstract' import N3NEP11SendAbstract from './N3NEP11SendAbstract' +import N3PendingAbstract from './N3PendingAbstract' type Props = { address: string, @@ -43,6 +44,7 @@ type Props = { }, showAddContactModal: ({ address: string }) => null, tx: Object, + renderN2Tx?: boolean, } export default class Transaction extends React.Component { @@ -56,10 +58,13 @@ export default class Transaction extends React.Component { chain, className, isPending, + renderN2Tx, } = this.props return (
- {chain === 'neo3' ? this.renderAbstractN3() : this.renderAbstract(type)} + {chain === 'neo3' && !renderN2Tx + ? this.renderAbstractN3() + : this.renderAbstract(type)} {!isPending && (