From dee260fc17821c3d769116452551648bd6da5686 Mon Sep 17 00:00:00 2001 From: Sinclair Chen Date: Mon, 2 May 2022 13:02:16 -0400 Subject: [PATCH] Sort donations chronologically --- web/pages/charity/[charitySlug].tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/pages/charity/[charitySlug].tsx b/web/pages/charity/[charitySlug].tsx index 6c3505fb..8f2091f7 100644 --- a/web/pages/charity/[charitySlug].tsx +++ b/web/pages/charity/[charitySlug].tsx @@ -42,6 +42,7 @@ function CharityPage(props: { charity: Charity }) { const user = useUser() const txns = useCharityTxns(charity.id) + const newToOld = _.sortBy(txns, (txn) => -txn.createdTime) const totalRaised = _.sumBy(txns, (txn) => txn.amount) const fromYou = _.sumBy( txns.filter((txn) => txn.fromId === user?.id), @@ -92,7 +93,7 @@ function CharityPage(props: { charity: Charity }) {

About

- {txns.map((txn) => ( + {newToOld.map((txn) => ( ))}