Prioritize newly marked media outlets at the top of the list

Update the sorting logic in MainContent.tsx to place media outlets with new articles at the beginning, followed by the rest sorted alphabetically.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9a264234-c5d7-4dcc-adf3-a954b149b30d
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3df548ff-50ae-432f-9be4-25d34eccc983/9a264234-c5d7-4dcc-adf3-a954b149b30d/X7hAtXn
This commit is contained in:
kimjaehyeon0101
2025-10-14 00:30:12 +00:00
parent 3ac2b2756a
commit 718c39c060
2 changed files with 16 additions and 0 deletions

View File

@ -26,10 +26,18 @@ externalPort = 5173
localPort = 37531
externalPort = 3001
[[ports]]
localPort = 38049
externalPort = 5000
[[ports]]
localPort = 38387
externalPort = 3003
[[ports]]
localPort = 41425
externalPort = 6000
[[ports]]
localPort = 43349
externalPort = 3000

View File

@ -61,6 +61,14 @@ export default function MainContent() {
);
return filtered.sort((a, b) => {
const aHasArticles = (articleCountByOutlet[a.id] || 0) > 0;
const bHasArticles = (articleCountByOutlet[b.id] || 0) > 0;
// First, sort by NEW badge (outlets with articles come first)
if (aHasArticles && !bHasArticles) return -1;
if (!aHasArticles && bHasArticles) return 1;
// Within same group (both have or both don't have articles), sort by chosen method
if (sortBy === "alphabetical") {
return a.name.localeCompare(b.name);
} else {