diff --git a/src/components/Activity/ActivityPage.tsx b/src/components/Activity/ActivityPage.tsx index 1930bf3a8..3268c777a 100644 --- a/src/components/Activity/ActivityPage.tsx +++ b/src/components/Activity/ActivityPage.tsx @@ -101,43 +101,57 @@ export function ActivityPage() { Continue Following
- {learningRoadmaps.reverse().map((roadmap) => ( - { - pageLoadingMessage.set('Updating activity'); - loadActivity().finally(() => { - pageLoadingMessage.set(''); - }); - }} - /> - ))} + {learningRoadmaps + .sort((a, b) => { + const updatedAtA = new Date(a.updatedAt); + const updatedAtB = new Date(b.updatedAt); - {learningBestPractices.reverse().map((bestPractice) => ( - { - pageLoadingMessage.set('Updating activity'); - loadActivity().finally(() => { - pageLoadingMessage.set(''); - }); - }} - /> - ))} + return updatedAtB.getTime() - updatedAtA.getTime(); + }) + .map((roadmap) => ( + { + pageLoadingMessage.set('Updating activity'); + loadActivity().finally(() => { + pageLoadingMessage.set(''); + }); + }} + /> + ))} + + {learningBestPractices + .sort((a, b) => { + const updatedAtA = new Date(a.updatedAt); + const updatedAtB = new Date(b.updatedAt); + + return updatedAtB.getTime() - updatedAtA.getTime(); + }) + .map((bestPractice) => ( + { + pageLoadingMessage.set('Updating activity'); + loadActivity().finally(() => { + pageLoadingMessage.set(''); + }); + }} + /> + ))}
)}