From 6fb3de560c7895e1d71f91c2adec7db5ca934da7 Mon Sep 17 00:00:00 2001 From: Afonso Santos Date: Mon, 16 Oct 2023 21:15:41 +0100 Subject: [PATCH 1/2] reverseevents order --- apps/app/pages/events.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/app/pages/events.js b/apps/app/pages/events.js index e9bd9a7a..e6ac04b0 100644 --- a/apps/app/pages/events.js +++ b/apps/app/pages/events.js @@ -11,11 +11,13 @@ const { Title } = Typography; function Events() { const { data: events, isLoading } = useEvents(); + let reversedEvents = events ? events.slice().reverse() : []; + return ( Eventos - {events?.map((info) => ( + {reversedEvents?.map((info) => ( From d1c3045cec07b311960e168cb612866af67d66e7 Mon Sep 17 00:00:00 2001 From: Afonso Santos Date: Mon, 16 Oct 2023 22:18:41 +0100 Subject: [PATCH 2/2] refactor --- apps/app/pages/events.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/app/pages/events.js b/apps/app/pages/events.js index e6ac04b0..54dd1843 100644 --- a/apps/app/pages/events.js +++ b/apps/app/pages/events.js @@ -10,8 +10,7 @@ const { Title } = Typography; function Events() { const { data: events, isLoading } = useEvents(); - - let reversedEvents = events ? events.slice().reverse() : []; + let reversedEvents = events ? [...events].reverse() : []; return (