Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

order integrations

Steven Tey1166cf4435b3
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/integrations/integrations-cards.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/integrations/integrations-cards.tsx
index 3ca98057f8..26cdcc5630 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/integrations/integrations-cards.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/integrations/integrations-cards.tsx
@@ -50,6 +50,17 @@ export async function IntegrationsCards({
{} as Record<string, IntegrationsWithInstallations>,
);
+ // Sort integrations within each category
+ Object.keys(groupedIntegrations).forEach((category) => {
+ groupedIntegrations[category].sort((a, b) => {
+ // Put "coming soon" integrations at the end
+ if (a.comingSoon && !b.comingSoon) return 1;
+ if (!a.comingSoon && b.comingSoon) return -1;
+ // Sort by installation count in descending order
+ return (b._count.installations || 0) - (a._count.installations || 0);
+ });
+ });
+
const categories = Object.keys(groupedIntegrations).sort(
(a, b) =>
CATEGORY_ORDER.indexOf(a as any) - CATEGORY_ORDER.indexOf(b as any),