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.

update mobile nav

Steven Tey1e4262fb19be
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 52c8c4fb49..63b737424f 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -1,7 +1,7 @@
{
"name": "@dub/ui",
"description": "UI components for Dub.co",
- "version": "0.2.1",
+ "version": "0.2.2",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
diff --git a/packages/ui/src/content.ts b/packages/ui/src/content.ts
index 711d91e3a1..2a69a89146 100644
--- a/packages/ui/src/content.ts
+++ b/packages/ui/src/content.ts
@@ -1,62 +1,53 @@
import {
Book2Fill,
BulletListFill,
- ChartLine,
- Code,
+ ConnectedDotsFill,
+ CubeSettingsFill,
FeatherFill,
Go,
HeadsetFill,
Hyperlink,
- OfficeBuilding,
- Paintbrush,
+ LinesY,
+ MessageSmile,
Php,
ProductHunt,
Python,
- QRCode,
Raycast,
Ruby,
Typescript,
- Users,
- WindowSettings,
} from "./icons";
import { Elxo } from "./icons/elxo";
export const FEATURES_LIST = [
{
- title: "Advanced Analytics",
- description: "Powerful Analytics For The Modern Marketer",
- icon: ChartLine,
- href: "/help/article/dub-analytics",
- },
- {
- title: "Branded Links",
- description: "Branded Links That Stand Out",
+ title: "Dub Links",
+ description: "Short links with superpowers",
icon: Hyperlink,
- href: "/features/branded-links",
+ href: "/home",
},
{
- title: "QR Codes",
- description: "Gorgeous QR codes for your links",
- icon: QRCode,
- href: "/features/qr-codes",
+ title: "Dub Analytics",
+ description: "Powerful real-time analytics",
+ icon: LinesY,
+ href: "/help/article/dub-analytics",
},
{
- title: "Personalization",
- description: "Personalize Your Short Links",
- icon: Paintbrush,
- href: "/features/personalization",
+ title: "Dub API",
+ description: "Programmatic link creation at scale",
+ icon: CubeSettingsFill,
+ href: "/docs/api-reference/introduction",
},
{
- title: "Collaboration",
- description: "Collaborate With Your Team",
- icon: Users,
- href: "/features/collaboration",
+ title: "Dub Integrations",
+ description: "Connect Dub with your favorite tools",
+ icon: ConnectedDotsFill,
+ href: "/docs/integrations",
},
{
- title: "API",
- description: "Programmatic Link Creation",
- icon: WindowSettings,
- href: "/docs/api-reference/introduction",
+ title: "Customer Stories",
+ description: "See how our customers use Dub",
+ icon: MessageSmile,
+ href: "/customers",
},
];
@@ -84,21 +75,6 @@ export const CUSTOMER_STORIES = [
},
];
-export const PROFILES = [
- {
- icon: Code,
- title: "Developers",
- description: "API for efficient link management",
- href: "/docs/introduction",
- },
- {
- icon: OfficeBuilding,
- title: "Enterprise",
- description: "Scalable link management solutions",
- href: "/enterprise",
- },
-];
-
export const SDKS = [
{
icon: Typescript,
diff --git a/packages/ui/src/icons/nucleo/connected-dots-fill.tsx b/packages/ui/src/icons/nucleo/connected-dots-fill.tsx
new file mode 100644
index 0000000000..70e060345a
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/connected-dots-fill.tsx
@@ -0,0 +1,73 @@
+import { SVGProps } from "react";
+
+export function ConnectedDotsFill(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" {...props}>
+ <g fill="currentColor">
+ <line
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ x1="7.954"
+ x2="5.047"
+ y1="5.988"
+ y2="11.511"
+ />
+ <line
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ x1="10.046"
+ x2="12.953"
+ y1="5.988"
+ y2="11.511"
+ />
+ <line
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ x1="6.25"
+ x2="11.75"
+ y1="13.25"
+ y2="13.25"
+ />
+ <circle
+ cx="9"
+ cy="4"
+ fill="currentColor"
+ r="2.25"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <circle
+ cx="14"
+ cy="13.5"
+ fill="currentColor"
+ r="2.25"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <circle
+ cx="4"
+ cy="13.5"
+ fill="currentColor"
+ r="2.25"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/index.ts b/packages/ui/src/icons/nucleo/index.ts
index 1765abea98..815876887a 100644
--- a/packages/ui/src/icons/nucleo/index.ts
+++ b/packages/ui/src/icons/nucleo/index.ts
@@ -41,6 +41,7 @@ export * from "./cloud-upload";
export * from "./code";
export * from "./color-palette2";
export * from "./connected-dots";
+export * from "./connected-dots-fill";
export * from "./connected-dots4";
export * from "./connections3";
export * from "./crosshairs3";
@@ -98,6 +99,7 @@ export * from "./location-pin";
export * from "./magnifier";
export * from "./map-position";
export * from "./menu3";
+export * from "./message-smile";
export * from "./mobile-phone";
export * from "./money-bill2";
export * from "./money-bills2";
diff --git a/packages/ui/src/icons/nucleo/message-smile.tsx b/packages/ui/src/icons/nucleo/message-smile.tsx
new file mode 100644
index 0000000000..063d8e6237
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/message-smile.tsx
@@ -0,0 +1,14 @@
+import { SVGProps } from "react";
+
+export function MessageSmile(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg" {...props}>
+ <g fill="currentColor">
+ <path
+ d="M9,1C4.589,1,1,4.589,1,9c0,1.397,.371,2.778,1.062,3.971,.238,.446-.095,2.002-.842,2.749-.209,.209-.276,.522-.17,.798,.105,.276,.364,.465,.659,.481,.079,.004,.16,.006,.242,.006,1.145,0,2.534-.407,3.44-.871,.675,.343,1.39,.587,2.131,.727,.484,.092,.981,.138,1.478,.138,4.411,0,8-3.589,8-8S13.411,1,9,1Zm3.529,11.538c-.944,.943-2.198,1.462-3.529,1.462s-2.593-.522-3.539-1.47c-.292-.293-.292-.768,0-1.061,.294-.293,.77-.292,1.062,0,1.322,1.326,3.621,1.328,4.947,.006,.293-.294,.768-.292,1.061,0,.292,.293,.292,.768-.002,1.061Z"
+ fill="currentColor"
+ />
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/nav/content/product-content.tsx b/packages/ui/src/nav/content/product-content.tsx
index 671763ed22..59ac12f121 100644
--- a/packages/ui/src/nav/content/product-content.tsx
+++ b/packages/ui/src/nav/content/product-content.tsx
@@ -1,7 +1,7 @@
import { cn, createHref } from "@dub/utils";
import Link from "next/link";
import { COMPARE_PAGES, CUSTOMER_STORIES } from "../../content";
-import { CubeSettingsFill, Toggle2Fill } from "../../icons";
+import { ConnectedDotsFill, CubeSettingsFill } from "../../icons";
import { AnalyticsGraphic } from "./graphics/analytics-graphic";
import { LinksGraphic } from "./graphics/links-graphic";
import {
@@ -13,14 +13,14 @@ import {
const largeLinks = [
{
title: "Dub API",
- description: "Unlock further capabilities",
+ description: "Programmatic link creation at scale",
icon: CubeSettingsFill,
href: "/docs/api-reference/introduction",
},
{
title: "Dub Integrations",
- description: "Enhance your short links",
- icon: Toggle2Fill,
+ description: "Connect Dub with your favorite tools",
+ icon: ConnectedDotsFill,
href: "/docs/integrations",
},
];
@@ -37,27 +37,27 @@ export function ProductContent({ domain }: { domain: string }) {
Dub Links
</span>
<p className="mt-3 max-w-56 text-sm text-neutral-500 dark:text-white/60">
- Short links with superpowers for modern marketing teams.
+ Short links with superpowers for the modern marketer
</p>
</div>
<div className="relative grow overflow-hidden">
<LinksGraphic className="absolute bottom-0 h-auto w-full [mask-image:linear-gradient(transparent,black_20%,black_80%,transparent)]" />
</div>
- <div className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_100%,#f4950c,transparent)] opacity-[0.07] transition-opacity group-hover:opacity-[0.12]" />
+ <div className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_100%,#f4950c,transparent)] opacity-[0.07] transition-opacity duration-150 group-hover:opacity-[0.2]" />
</Link>
<div className="flex flex-col gap-4">
<Link
- href={createHref("/home", domain)}
+ href={createHref("/help/article/dub-analytics", domain)}
className="group relative flex flex-col overflow-hidden rounded-xl border border-neutral-100 bg-neutral-50 dark:border-white/20 dark:bg-white/10"
>
<AnalyticsGraphic className="absolute bottom-0 h-auto w-full translate-y-[15%] [mask-image:linear-gradient(90deg,transparent,black)]" />
- <div className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_100%,#36D78F,transparent)] opacity-[0.07] transition-opacity group-hover:opacity-[0.12]" />
+ <div className="pointer-events-none absolute inset-0 bg-[radial-gradient(circle_at_50%_100%,#36D78F,transparent)] opacity-[0.07] transition-opacity duration-150 group-hover:opacity-[0.2]" />
<div className="h-56 p-5">
<span className="text-sm font-medium text-neutral-900 dark:text-white">
Dub Analytics
</span>
<p className="mt-3 max-w-48 text-sm text-neutral-500 dark:text-white/60">
- Powerful analytics delivered instantly.
+ Powerful real-time analytics with conversion tracking
</p>
</div>
</Link>
diff --git a/packages/ui/src/nav/content/shared.tsx b/packages/ui/src/nav/content/shared.tsx
index e9350fa018..2715ee946e 100644
--- a/packages/ui/src/nav/content/shared.tsx
+++ b/packages/ui/src/nav/content/shared.tsx
@@ -96,7 +96,7 @@ export function LargeLinkCard({
return (
<Link
{...rest}
- className="group relative flex flex-col rounded-xl border border-neutral-100 bg-neutral-50 transition-colors duration-75 hover:bg-neutral-100 active:bg-neutral-200 dark:border-white/20 dark:bg-white/10 dark:hover:bg-white/15 dark:active:bg-white/20"
+ className="group relative flex flex-col rounded-xl border border-neutral-100 bg-neutral-50 transition-colors duration-150 hover:bg-neutral-100 active:bg-neutral-200 dark:border-white/20 dark:bg-white/10 dark:hover:bg-white/15 dark:active:bg-white/20"
>
<div className="flex items-center justify-between px-5 py-4">
<div>
diff --git a/packages/ui/src/nav/content/solutions-content.tsx b/packages/ui/src/nav/content/solutions-content.tsx
index 086d5d50ec..d93f597246 100644
--- a/packages/ui/src/nav/content/solutions-content.tsx
+++ b/packages/ui/src/nav/content/solutions-content.tsx
@@ -1,11 +1,26 @@
import { cn, createHref } from "@dub/utils";
-import { PROFILES } from "../../content";
+import { Code, OfficeBuilding } from "../../icons";
import {
ContentIcon,
ContentLinkCard,
contentHeadingClassName,
} from "./shared";
+const PROFILES = [
+ {
+ icon: Code,
+ title: "Developers",
+ description: "API for efficient link management",
+ href: "/docs/introduction",
+ },
+ {
+ icon: OfficeBuilding,
+ title: "Enterprise",
+ description: "Scalable link management solutions",
+ href: "/enterprise",
+ },
+];
+
export function SolutionsContent({ domain }: { domain: string }) {
return (
<div className="grid w-[32rem] grid-cols-[5fr_3.5fr]">
diff --git a/packages/ui/src/nav/nav-mobile.tsx b/packages/ui/src/nav/nav-mobile.tsx
index 937109a91f..d4cb38921d 100644
--- a/packages/ui/src/nav/nav-mobile.tsx
+++ b/packages/ui/src/nav/nav-mobile.tsx
@@ -117,6 +117,7 @@ const MobileNavItem = ({
href?: string;
childItems?: {
title: string;
+ description: string;
href: string;
icon: ElementType;
iconClassName?: string;
@@ -144,7 +145,7 @@ const MobileNavItem = ({
</button>
{expanded && (
<div className="grid gap-4 overflow-hidden py-4">
- {childItems.map(({ title, href, icon: Icon, iconClassName }) => (
+ {childItems.map(({ title, href, icon: Icon, description }) => (
<Link
key={href}
href={createHref(href, domain, {
@@ -154,15 +155,19 @@ const MobileNavItem = ({
utm_content: title,
})}
onClick={() => setOpen(false)}
- className="flex w-full space-x-2"
+ className="flex w-full gap-3"
>
- <Icon
- className={cn(
- "h-5 w-5 text-gray-500 dark:text-white/80",
- iconClassName,
- )}
- />
- <span className="text-sm">{title}</span>
+ <div className="flex size-10 items-center justify-center rounded-lg border border-neutral-200 bg-gradient-to-t from-neutral-100">
+ <Icon className="size-5 text-neutral-700" />
+ </div>
+ <div>
+ <div className="flex items-center gap-2">
+ <h2 className="text-sm font-medium text-neutral-900">
+ {title}
+ </h2>
+ </div>
+ <p className="text-sm text-neutral-500">{description}</p>
+ </div>
</Link>
))}
</div>
diff --git a/packages/ui/src/nav/nav.tsx b/packages/ui/src/nav/nav.tsx
index 10c71d9949..199756caaf 100644
--- a/packages/ui/src/nav/nav.tsx
+++ b/packages/ui/src/nav/nav.tsx
@@ -27,7 +27,7 @@ export const navItems = [
name: "Product",
content: ProductContent,
childItems: FEATURES_LIST,
- segments: ["/", "/home", "/features"],
+ segments: ["/features", "/customers", "/compare"],
},
{
name: "Resources",
@@ -129,9 +129,7 @@ export function Nav({
{navItems.map(
({ name, href, segments, content: Content }) => {
const isActive = segments.some((segment) =>
- segment === "/"
- ? pathname === segment
- : pathname?.startsWith(segment),
+ pathname?.startsWith(segment),
);
return (
<NavigationMenuPrimitive.Item key={name}>