Skip to content

Commit

Permalink
frontend trends limit 6 topics (#878)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by OSS
Entelligence.AI -->
### Summary by Entelligence.AI

- Refactor: Updated the Trends Main Page component to limit the number
of topics displayed per category to a maximum of 6. This change enhances
the user interface by preventing overcrowding and improving readability.
<!-- end of auto-generated comment: release notes by OSS Entelligence.AI
-->
  • Loading branch information
josancamon19 authored Sep 17, 2024
2 parents caf15d8 + 1f52a93 commit 58cc8ed
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions frontend/src/components/trends/get-trends-main-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ export default async function GetTrendsMainPage() {

if (!acc[category]) acc[category] = { best: [], worst: [] };

acc[category][type === 'best' ? 'best' : 'worst'] = [
...acc[category][type === 'best' ? 'best' : 'worst'],
const topicsToPush = type === 'best' ? 'best' : 'worst';
acc[category][topicsToPush] = [
...acc[category][topicsToPush],
...topics,
];
].slice(0, 6); // Limit to max 6

return acc;
}, {});
Expand Down

0 comments on commit 58cc8ed

Please sign in to comment.