The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Move `/[slug]` to `/[slug]/links`
Tim Wilsonee95e75eb78c
diff --git a/apps/web/app/admin.dub.co/(dashboard)/links/page.tsx b/apps/web/app/admin.dub.co/(dashboard)/links/page.tsxindex cbc4c5f5df..4256ef43ef 100644--- a/apps/web/app/admin.dub.co/(dashboard)/links/page.tsx+++ b/apps/web/app/admin.dub.co/(dashboard)/links/page.tsx@@ -1,4 +1,4 @@-import AdminLinksClient from "app/app.dub.co/(dashboard)/[slug]/page-client";+import AdminLinksClient from "app/app.dub.co/(dashboard)/[slug]/links/page-client";import { Suspense } from "react";export default function AdminLinks() {diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/links-title.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/links/links-title.tsxsimilarity index 100%rename from apps/web/app/app.dub.co/(dashboard)/[slug]/links-title.tsxrename to apps/web/app/app.dub.co/(dashboard)/[slug]/links/links-title.tsxdiff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/links/page-client.tsxsimilarity index 100%rename from apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsxrename to apps/web/app/app.dub.co/(dashboard)/[slug]/links/page-client.tsxdiff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/links/page.tsxsimilarity index 100%rename from apps/web/app/app.dub.co/(dashboard)/[slug]/page.tsxrename to apps/web/app/app.dub.co/(dashboard)/[slug]/links/page.tsxdiff --git a/apps/web/lib/middleware/app.ts b/apps/web/lib/middleware/app.tsindex a0be0a8878..e697e255db 100644--- a/apps/web/lib/middleware/app.ts+++ b/apps/web/lib/middleware/app.ts@@ -83,6 +83,7 @@ export default async function AppMiddleware(req: NextRequest) {"/login","/register","/workspaces",+ "/links","/analytics","/events","/programs",diff --git a/apps/web/lib/middleware/utils/app-redirect.ts b/apps/web/lib/middleware/utils/app-redirect.tsindex c9e314f395..3c2f9a5dee 100644--- a/apps/web/lib/middleware/utils/app-redirect.ts+++ b/apps/web/lib/middleware/utils/app-redirect.ts@@ -9,6 +9,10 @@ export const appRedirect = (path: string) => {return APP_REDIRECTS[path];}+ // Redirect "/[slug]" to "/[slug]/links"+ const rootRegex = /^\/([^\/]+)$/;+ if (rootRegex.test(path)) return path.replace(rootRegex, "/$1/links");+// Redirect "programs/[programId]/settings" to "programs/[programId]/settings/rewards" (first tab)const programSettingsRegex = /\/programs\/([^\/]+)\/settings$/;if (programSettingsRegex.test(path))diff --git a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsxindex 237233b988..3edc6fe0ed 100644--- a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx+++ b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx@@ -50,8 +50,7 @@ const NAV_AREAS: SidebarNavAreas<{{name: "Links",icon: Hyperlink,- href: `/${slug}${pathname === `/${slug}` ? "" : queryString}`,- exact: true,+ href: `/${slug}/links${pathname === `/${slug}/links` ? "" : queryString}`,},{name: "Analytics",