Skip to content

Commit 57c13c9

Browse files
committed
feat(neuron-ui): update display of recent activities
use absolute value of transaction's amount in the recent activities
1 parent 7d2b5b8 commit 57c13c9

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

packages/neuron-ui/src/components/Overview/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ const Overview = ({
320320
return {
321321
...item,
322322
status,
323+
value: item.value.replace(/^-/, ''),
323324
confirmations: item.status === 'success' ? confirmations : '',
324325
typeLabel: t(`overview.${typeLabel}`),
325326
}

packages/neuron-ui/src/stories/data/transactions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const transactions: {
88
createdAt: (new Date(1565240655845).getTime() - 100000).toString(),
99
updatedAt: '',
1010
timestamp: '',
11-
value: '10000',
11+
value: '-10000',
1212
hash: '0x70abeeaa2ed08b7d7659341a122b9a2f2ede99bb6bd0df7398d7ffe488beab61',
1313
description: 'description of send transaction',
1414
blockNumber: '120',
@@ -30,7 +30,7 @@ const transactions: {
3030
createdAt: '',
3131
updatedAt: '',
3232
timestamp: (new Date(1565240655845).getTime() - 300000).toString(),
33-
value: '10000',
33+
value: '-10000',
3434
hash: '0x70abeeaa2ed08b7d7659341a122b9a2f2ede99bb6bd0df7398d7ffe488beab63',
3535
description: 'description of send transaction',
3636
blockNumber: '0',
@@ -52,7 +52,7 @@ const transactions: {
5252
createdAt: (new Date(1565240655845).getTime() - 500000).toString(),
5353
updatedAt: '',
5454
timestamp: '',
55-
value: '10000',
55+
value: '-10000',
5656
hash: '0x70abeeaa2ed08b7d7659341a122b9a2f2ede99bb6bd0df7398d7ffe488beab65',
5757
description: 'description of send transaction',
5858
blockNumber: '0',
@@ -74,7 +74,7 @@ const transactions: {
7474
createdAt: new Date('2019-05-18').getTime().toString(),
7575
updatedAt: '',
7676
timestamp: '',
77-
value: '10000',
77+
value: '-10000',
7878
hash: '0x70abeeaa2ed08b7d7659341a122b9a2f2ede99bb6bd0df7398d7ffe488beab67',
7979
description: 'description of send transaction',
8080
blockNumber: '0',
@@ -96,7 +96,7 @@ const transactions: {
9696
createdAt: new Date('2019-04-18').getTime().toString(),
9797
updatedAt: '',
9898
timestamp: '',
99-
value: '10000',
99+
value: '-10000',
100100
hash: '0x70abeeaa2ed08b7d7659341a122b9a2f2ede99bb6bd0df7398d7ffe488beab69',
101101
description: 'description of send transaction',
102102
blockNumber: '0',
@@ -118,7 +118,7 @@ const transactions: {
118118
createdAt: new Date('2019-04-17').getTime().toString(),
119119
updatedAt: '',
120120
timestamp: '',
121-
value: '10000',
121+
value: '-10000',
122122
hash: '0x70abeeaa2ed08b7d7659341a122b9a2f2ede99bb6bd0df7398d7ffe488beab11',
123123
description: 'description of send transaction',
124124
blockNumber: '0',

0 commit comments

Comments
 (0)