1
1
import React , { useContext } from 'react' ;
2
2
import { Link } from 'react-router-dom' ;
3
- import { getTransactionAmount } from '@transaction/utils/transaction' ;
3
+ import { getTransactionValue } from '@transaction/utils/transaction' ;
4
4
import { MODULE_COMMANDS_NAME_MAP } from 'src/modules/transaction/configuration/moduleCommand' ;
5
5
import DateTimeFromTimestamp from 'src/modules/common/components/timestamp' ;
6
6
import WalletVisual from '@wallet/components/walletVisual' ;
@@ -22,7 +22,6 @@ import { getValidatorDetailsClass } from '@pos/validator/components/ValidatorsTa
22
22
import styles from './row.css' ;
23
23
import TransactionRowContext from '../../context/transactionRowContext' ;
24
24
import TransactionTypeFigure from '../TransactionTypeFigure' ;
25
- import TransactionAmount from '../TransactionAmount' ;
26
25
27
26
export const ID = ( { isWallet } ) => {
28
27
const { data, address } = useContext ( TransactionRowContext ) ;
@@ -54,13 +53,20 @@ export const Type = () => {
54
53
return < span className = { styles . type } > { formatTransactionType ( data . moduleCommand ) } </ span > ;
55
54
} ;
56
55
57
- export const ValidatorDetails = ( ) => {
58
- const { data, activeTab } = useContext ( TransactionRowContext ) ;
56
+ export const ValidatorDetails = ( { isWallet } ) => {
57
+ const { data, activeTab, address } = useContext ( TransactionRowContext ) ;
59
58
60
59
return (
61
60
< span className = { getValidatorDetailsClass ( activeTab ) } >
62
61
< div className = { styles . validatorColumn } >
63
62
< div className = { `${ styles . validatorDetails } ` } >
63
+ { isWallet && (
64
+ < Icon
65
+ name = {
66
+ data . sender . address === address ? 'sentTransactionIcon' : 'receivedTransactionIcon'
67
+ }
68
+ />
69
+ ) }
64
70
< WalletVisual address = { data . sender . address } />
65
71
< div >
66
72
< p className = { styles . validatorName } > { data . sender . name } </ p >
@@ -72,7 +78,7 @@ export const ValidatorDetails = () => {
72
78
) ;
73
79
} ;
74
80
75
- export const Sender = ( ) => < ValidatorDetails /> ;
81
+ export const Sender = ( { isWallet } ) => < ValidatorDetails isWallet = { isWallet } /> ;
76
82
77
83
export const Recipient = ( ) => {
78
84
const { data, avatarSize } = useContext ( TransactionRowContext ) ;
@@ -140,30 +146,8 @@ export const Date = ({ t }) => {
140
146
} ;
141
147
142
148
export const Amount = ( ) => {
143
- const { data, layout, activeToken, host, token } = useContext ( TransactionRowContext ) ;
144
-
145
- if ( layout !== 'full' ) {
146
- return (
147
- < span >
148
- < TransactionAmount
149
- host = { host }
150
- token = { activeToken }
151
- showRounded
152
- recipient = { data . params . recipientAddress }
153
- moduleCommand = { data . moduleCommand }
154
- amount = { getTransactionAmount ( data ) }
155
- />
156
- </ span >
157
- ) ;
158
- }
159
- return (
160
- < span className = { styles . amount } >
161
- < TokenAmount val = { getTransactionAmount ( data ) } token = { token } />
162
- < span className = { `${ styles . fee } hideOnLargeViewPort` } >
163
- < TokenAmount val = { data . fee } token = { token } />
164
- </ span >
165
- </ span >
166
- ) ;
149
+ const { data, token } = useContext ( TransactionRowContext ) ;
150
+ return < span className = { styles . amount } > { getTransactionValue ( data , token ) } </ span > ;
167
151
} ;
168
152
169
153
export const Fee = ( { t } ) => {
0 commit comments