From f5d40a029a64092b2fda6a3e1087307510ed4f41 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Thu, 25 Mar 2021 07:29:20 +0100 Subject: [PATCH] Crowdloan sorting --- .../src/Crowdloan/FundContribute.tsx | 14 +++++++++++++- packages/page-parachains/src/Crowdloan/useFunds.ts | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/page-parachains/src/Crowdloan/FundContribute.tsx b/packages/page-parachains/src/Crowdloan/FundContribute.tsx index 306d0c0145..5e1213b67f 100644 --- a/packages/page-parachains/src/Crowdloan/FundContribute.tsx +++ b/packages/page-parachains/src/Crowdloan/FundContribute.tsx @@ -57,7 +57,7 @@ function FundContribute ({ cap, className, paraId, raised }: Props): React.React value={accountId} /> - ('The amount to contribute. Should be less than the remaining value and more than the minimum contribution amount.')}> + ('The amount to contribute from this account.')}> ('The amount is more than the remaining contribution needed {{value}}', { replace: { value: formatBalance(remaining) } })} /> )} + ('The above contribution should more than minimum contribution amount and less than the remaining value.')}> + ('minimum allowed')} + /> + ('remaining till cap')} + /> + [], paraIds: ParaId[]): Cam ? paraIds .map((paraId, i) => ({ info: optFunds[i].unwrapOr(null), key: paraId.toString(), paraId })) .filter((fund): fund is Campaign => !!fund.info) + .sort((a, b) => a.info.firstSlot.cmp(b.info.firstSlot) || a.info.lastSlot.cmp(b.info.lastSlot) || a.paraId.cmp(b.paraId)) : null; }