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.

Add nav item + page

Tim Wilson5f8670fe20a2
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/customers/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/customers/page.tsx
new file mode 100644
index 0000000000..249b3b71f4
--- /dev/null
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/customers/page.tsx
@@ -0,0 +1,10 @@
+import { PageContent } from "@/ui/layout/page-content";
+import { MaxWidthWrapper } from "@dub/ui";
+
+export default function CustomersPage() {
+ return (
+ <PageContent title="Customers">
+ <MaxWidthWrapper>WIP</MaxWidthWrapper>
+ </PageContent>
+ );
+}
diff --git a/apps/web/lib/middleware/app.ts b/apps/web/lib/middleware/app.ts
index 19d27fe575..3b1b963349 100644
--- a/apps/web/lib/middleware/app.ts
+++ b/apps/web/lib/middleware/app.ts
@@ -86,6 +86,7 @@ export default async function AppMiddleware(req: NextRequest) {
"/links",
"/analytics",
"/events",
+ "/customers",
"/programs",
"/settings",
"/upgrade",
diff --git a/apps/web/lib/middleware/utils/app-redirect.ts b/apps/web/lib/middleware/utils/app-redirect.ts
index a07f2c32b0..3b444b34a7 100644
--- a/apps/web/lib/middleware/utils/app-redirect.ts
+++ b/apps/web/lib/middleware/utils/app-redirect.ts
@@ -21,11 +21,6 @@ export const appRedirect = (path: string) => {
if (upgradeRegex.test(path))
return path.replace(upgradeRegex, "/$1/settings/billing/upgrade");
- // Redirect "/[slug]/customers" to "/[slug]/events?event=leads" for now
- const customersRegex = /^\/([^\/]+)\/customers$/;
- if (customersRegex.test(path))
- return path.replace(customersRegex, "/$1/events?event=leads");
-
// 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.tsx
index 9524a41921..00f9921302 100644
--- a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
+++ b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
@@ -14,7 +14,6 @@ import {
Key,
Receipt2,
ShieldCheck,
- Users2,
Users6,
Webhook,
} from "@dub/ui/icons";
@@ -27,6 +26,7 @@ import { CursorRays } from "./icons/cursor-rays";
import { Gear } from "./icons/gear";
import { Hyperlink } from "./icons/hyperlink";
import { LinesY } from "./icons/lines-y";
+import { User } from "./icons/user";
import { SidebarNav, SidebarNavAreas } from "./sidebar-nav";
import { Usage } from "./usage";
import { WorkspaceDropdown } from "./workspace-dropdown";
@@ -62,15 +62,11 @@ const NAV_AREAS: SidebarNavAreas<{
icon: CursorRays,
href: `/${slug}/events${pathname === `/${slug}/events` ? "" : queryString}`,
},
- ...(pathname.startsWith(`/${slug}/customers`)
- ? [
- {
- name: "Customers",
- icon: Users2,
- href: `/${slug}/customers`,
- },
- ]
- : []),
+ {
+ name: "Customers",
+ icon: User,
+ href: `/${slug}/customers`,
+ },
{
name: "Settings",
icon: Gear,
diff --git a/apps/web/ui/layout/sidebar/icons/user.tsx b/apps/web/ui/layout/sidebar/icons/user.tsx
new file mode 100644
index 0000000000..6960b82e65
--- /dev/null
+++ b/apps/web/ui/layout/sidebar/icons/user.tsx
@@ -0,0 +1,66 @@
+import { SVGProps, useEffect, useRef } from "react";
+
+export function User({
+ "data-hovered": hovered,
+ ...rest
+}: { "data-hovered"?: boolean } & SVGProps<SVGSVGElement>) {
+ const headRef = useRef<SVGCircleElement>(null);
+ const bodyRef = useRef<SVGPathElement>(null);
+
+ useEffect(() => {
+ if (!headRef.current || !bodyRef.current) return;
+
+ if (hovered) {
+ headRef.current.animate(
+ [
+ { transform: "translateY(0)" },
+ { transform: "translateY(-10%)" },
+ { transform: "translateY(0)" },
+ ],
+ {
+ duration: 300,
+ },
+ );
+
+ bodyRef.current.animate(
+ [
+ { transform: "scaleX(1)" },
+ { transform: "scaleX(1.15)" },
+ { transform: "scaleX(1)" },
+ ],
+ {
+ duration: 300,
+ },
+ );
+ }
+ }, [hovered]);
+
+ return (
+ <svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" {...rest}>
+ <g fill="currentColor">
+ <circle
+ ref={headRef}
+ cx="9"
+ cy="4.5"
+ fill="none"
+ r="2.75"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ className="[transform-box:fill-box] [transform-origin:center] [&_*]:[vector-effect:non-scaling-stroke]"
+ />
+ <path
+ ref={bodyRef}
+ d="M13.762,15.516c.86-.271,1.312-1.221,.947-2.045-.97-2.191-3.159-3.721-5.709-3.721s-4.739,1.53-5.709,3.721c-.365,.825,.087,1.774,.947,2.045,1.225,.386,2.846,.734,4.762,.734s3.537-.348,4.762-.734Z"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ className="[transform-box:fill-box] [transform-origin:center] [&_*]:[vector-effect:non-scaling-stroke]"
+ />
+ </g>
+ </svg>
+ );
+}