diff --git a/.replit b/.replit index 25794b7..b94bf6b 100644 --- a/.replit +++ b/.replit @@ -30,10 +30,6 @@ externalPort = 3001 localPort = 38387 externalPort = 3003 -[[ports]] -localPort = 41425 -externalPort = 6000 - [[ports]] localPort = 43349 externalPort = 3000 diff --git a/client/src/components/MainContent.tsx b/client/src/components/MainContent.tsx index 1bc83e5..df444ec 100644 --- a/client/src/components/MainContent.tsx +++ b/client/src/components/MainContent.tsx @@ -54,38 +54,20 @@ export default function MainContent() { return acc; }, {} as Record); - // Group outlets by category and separate NEW outlets from regular ones - const getSeparatedOutlets = (category: string) => { + // Group outlets by category and sort + const getOutletsByCategory = (category: string) => { const filtered = allOutlets.filter(outlet => outlet.category.toLowerCase() === category.toLowerCase() ); - // Separate outlets with articles (NEW) from those without - const newOutlets = filtered.filter(outlet => { - const articleCount = articleCountByOutlet[outlet.id] || 0; - return articleCount > 0; - }); - - const regularOutlets = filtered.filter(outlet => { - const articleCount = articleCountByOutlet[outlet.id] || 0; - return articleCount === 0; - }); - - // Sort both groups - const sortFn = (a: MediaOutlet, b: MediaOutlet) => { + return filtered.sort((a, b) => { if (sortBy === "alphabetical") { return a.name.localeCompare(b.name); } else { // Sort by traffic score (descending - highest traffic first) return (b.trafficScore || 0) - (a.trafficScore || 0); } - }; - - return { - newOutlets: newOutlets.sort(sortFn), - regularOutlets: regularOutlets.sort(sortFn), - total: filtered.length - }; + }); }; const renderOutletCard = (outlet: MediaOutlet) => { @@ -217,24 +199,10 @@ export default function MainContent() {

People - ({getSeparatedOutlets("People").total}) + ({getOutletsByCategory("People").length})

- {getSeparatedOutlets("People").newOutlets.length > 0 && ( - <> -
- -

NEW

-
-
- {getSeparatedOutlets("People").newOutlets.map(renderOutletCard)} -
- {getSeparatedOutlets("People").regularOutlets.length > 0 && ( -
- )} - - )} - {getSeparatedOutlets("People").regularOutlets.map(renderOutletCard)} + {getOutletsByCategory("People").map(renderOutletCard)}
@@ -242,24 +210,10 @@ export default function MainContent() {

Topics - ({getSeparatedOutlets("Topics").total}) + ({getOutletsByCategory("Topics").length})

- {getSeparatedOutlets("Topics").newOutlets.length > 0 && ( - <> -
- -

NEW

-
-
- {getSeparatedOutlets("Topics").newOutlets.map(renderOutletCard)} -
- {getSeparatedOutlets("Topics").regularOutlets.length > 0 && ( -
- )} - - )} - {getSeparatedOutlets("Topics").regularOutlets.map(renderOutletCard)} + {getOutletsByCategory("Topics").map(renderOutletCard)}
@@ -267,24 +221,10 @@ export default function MainContent() {

Companies - ({getSeparatedOutlets("Companies").total}) + ({getOutletsByCategory("Companies").length})

- {getSeparatedOutlets("Companies").newOutlets.length > 0 && ( - <> -
- -

NEW

-
-
- {getSeparatedOutlets("Companies").newOutlets.map(renderOutletCard)} -
- {getSeparatedOutlets("Companies").regularOutlets.length > 0 && ( -
- )} - - )} - {getSeparatedOutlets("Companies").regularOutlets.map(renderOutletCard)} + {getOutletsByCategory("Companies").map(renderOutletCard)}