handling pending requests extra data

This commit is contained in:
Nouman Tahir 2022-03-23 20:19:24 +05:00
parent 7f0dd8b017
commit 131c6b5671
4 changed files with 15 additions and 6 deletions

View File

@ -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"

View File

@ -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",

View File

@ -33,6 +33,7 @@ export interface CoinActivity {
iconType: string;
textKey: string;
created: string;
expires: string;
icon: string;
value:string;
details: string;

View File

@ -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;