mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-19 03:11:38 +03:00
handling pending requests extra data
This commit is contained in:
parent
7f0dd8b017
commit
131c6b5671
@ -21,7 +21,10 @@ const TransactionView = ({ item, index }) => {
|
||||
text={intl.formatMessage({
|
||||
id: `wallet.${get(item, 'textKey')}`,
|
||||
})}
|
||||
description={getTimeFromNow(get(item, 'created'))}
|
||||
description={
|
||||
(item.expires ? intl.formatMessage({ id: 'wallet.expires' }) + ' ' : '') +
|
||||
getTimeFromNow(item.expires || item.created)
|
||||
}
|
||||
isCircleIcon
|
||||
isThin
|
||||
circleIconColor="white"
|
||||
|
@ -127,7 +127,8 @@
|
||||
"activities":"Activities",
|
||||
"savings_withdrawal":"Pending Withdrawals",
|
||||
"open_orders":"Open Orders",
|
||||
"conversions_requested":"Converstions Requested"
|
||||
"conversions_requested":"Converstions Requested",
|
||||
"expires":"expires"
|
||||
},
|
||||
"notification": {
|
||||
"vote": "voted",
|
||||
|
@ -33,6 +33,7 @@ export interface CoinActivity {
|
||||
iconType: string;
|
||||
textKey: string;
|
||||
created: string;
|
||||
expires: string;
|
||||
icon: string;
|
||||
value:string;
|
||||
details: string;
|
||||
|
@ -291,9 +291,11 @@ const fetchPendingRequests = async (username: string, coinSymbol: string): Promi
|
||||
return ({
|
||||
iconType: "MaterialIcons",
|
||||
textKey: 'fill_order',
|
||||
created: request.expiration,
|
||||
expires: request.expiration,
|
||||
created: request.created,
|
||||
icon: 'reorder',
|
||||
value: request.sell_price.base
|
||||
value: request.sell_price.base,
|
||||
details: '',
|
||||
} as CoinActivity)
|
||||
})
|
||||
|
||||
@ -305,7 +307,9 @@ const fetchPendingRequests = async (username: string, coinSymbol: string): Promi
|
||||
textKey: "transfer_from_savings",
|
||||
created: request.complete,
|
||||
icon: "compare-arrows",
|
||||
value: request.amount
|
||||
value: request.amount,
|
||||
details: request.from && request.to ? `@${request.from} to @${request.to}` : null,
|
||||
memo: request.memo || null
|
||||
} as CoinActivity)
|
||||
})
|
||||
|
||||
@ -328,7 +332,7 @@ const fetchPendingRequests = async (username: string, coinSymbol: string): Promi
|
||||
];
|
||||
|
||||
pendingRequests.sort((a, b) => (
|
||||
new Date(a.created).getTime() > new Date(b.created).getTime() ? 1 : -1
|
||||
new Date(a.expires || a.created).getTime() > new Date(b.expires || b.created).getTime() ? 1 : -1
|
||||
))
|
||||
|
||||
return pendingRequests;
|
||||
|
Loading…
Reference in New Issue
Block a user