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 nav

Steven Teye0edaf039051
diff --git a/packages/ui/package.json b/packages/ui/package.json
index 610c76301b..e229035252 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.1.58",
+ "version": "0.1.59",
"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 96c065fe47..93d5388412 100644
--- a/packages/ui/src/content.ts
+++ b/packages/ui/src/content.ts
@@ -16,7 +16,6 @@ import {
QRCode,
Raycast,
Ruby,
- Stars2,
Tinybird,
Typescript,
Users,
@@ -140,16 +139,6 @@ export const SDKS = [
];
export const RESOURCES = [
- {
- icon: Headset,
- title: "Help Center",
- href: "/help",
- },
- {
- icon: Book2,
- title: "Docs",
- href: "/docs",
- },
{
icon: Blog,
title: "Blog",
@@ -161,9 +150,14 @@ export const RESOURCES = [
href: "/changelog",
},
{
- icon: Stars2,
- title: "Customers",
- href: "/customers",
+ icon: Book2,
+ title: "Docs",
+ href: "/docs",
+ },
+ {
+ icon: Headset,
+ title: "Help Center",
+ href: "/help",
},
{
icon: HexadecagonStar,
diff --git a/packages/ui/src/nav/content/resources-content.tsx b/packages/ui/src/nav/content/resources-content.tsx
index 004598c657..5de63e9178 100644
--- a/packages/ui/src/nav/content/resources-content.tsx
+++ b/packages/ui/src/nav/content/resources-content.tsx
@@ -1,74 +1,38 @@
import { cn, createHref } from "@dub/utils";
-import { RESOURCES } from "../../content";
-import {
- Amazon,
- ChatGPT,
- Figma,
- GitHubEnhanced,
- GoogleEnhanced,
- Spotify,
-} from "../../icons";
-import {
- ContentLinkCard,
- ToolLinkCard,
- contentHeadingClassName,
-} from "./shared";
-
-const items = [
- {
- name: "Spotify Link Shortener",
- href: "/tools/spotify-link-shortener",
- icon: Spotify,
- },
- {
- name: "ChatGPT Link Shortener",
- href: "/tools/chatgpt-link-shortener",
- icon: ChatGPT,
- },
- {
- name: "GitHub Link Shortener",
- href: "/tools/github-link-shortener",
- icon: GitHubEnhanced,
- },
- {
- name: "Google Link Shortener",
- href: "/tools/google-link-shortener",
- icon: GoogleEnhanced,
- },
- {
- name: "Amazon Link Shortener",
- href: "/tools/amazon-link-shortener",
- icon: Amazon,
- },
- {
- name: "Figma Link Shortener",
- href: "/tools/figma-link-shortener",
- icon: Figma,
- },
-];
+import { RESOURCES, SDKS } from "../../content";
+import { ContentLinkCard, contentHeadingClassName } from "./shared";
export function ResourcesContent({ domain }: { domain: string }) {
return (
- <div className="grid w-[32rem] grid-cols-[7fr_5fr]">
- <div className="p-5">
- <p className={cn(contentHeadingClassName, "mb-2")}>Tools</p>
- <div className="flex flex-col gap-2">
- {items.map(({ name, href, icon: Icon }) => (
- <ToolLinkCard
- name={name}
+ <div className="grid w-[28rem] grid-cols-2">
+ <div className="border-l border-gray-200 p-5 dark:border-white/20">
+ <p className={cn(contentHeadingClassName, "mb-2")}>SDKs</p>
+ <div className="-mx-2 flex flex-col gap-0.5">
+ {SDKS.map(({ icon: Icon, iconClassName, title, href }) => (
+ <ContentLinkCard
+ key={href}
href={createHref(href, domain, {
utm_source: "Custom Domain",
utm_medium: "Navbar",
utm_campaign: domain,
- utm_content: name,
+ utm_content: title,
})}
- icon={<Icon />}
+ icon={
+ <Icon
+ className={cn(
+ "h-5 w-5 shrink-0 text-gray-600 transition-colors dark:text-white/60",
+ iconClassName,
+ )}
+ />
+ }
+ title={title}
+ showArrow
/>
))}
</div>
</div>
<div className="border-l border-gray-200 p-5 dark:border-white/20">
- <p className={cn(contentHeadingClassName, "mb-2")}>Resources</p>
+ <p className={cn(contentHeadingClassName, "mb-2")}>Content</p>
<div className="-mx-2 flex flex-col gap-0.5">
{RESOURCES.map(({ icon: Icon, title, href }) => (
<ContentLinkCard
diff --git a/packages/ui/src/nav/content/solutions-content.tsx b/packages/ui/src/nav/content/solutions-content.tsx
index c36b888999..086d5d50ec 100644
--- a/packages/ui/src/nav/content/solutions-content.tsx
+++ b/packages/ui/src/nav/content/solutions-content.tsx
@@ -1,5 +1,5 @@
import { cn, createHref } from "@dub/utils";
-import { PROFILES, SDKS } from "../../content";
+import { PROFILES } from "../../content";
import {
ContentIcon,
ContentLinkCard,
@@ -27,32 +27,6 @@ export function SolutionsContent({ domain }: { domain: string }) {
))}
</div>
</div>
- <div className="border-l border-gray-200 p-5 dark:border-white/20">
- <p className={cn(contentHeadingClassName, "mb-2")}>SDKs</p>
- <div className="-mx-2 flex flex-col gap-0.5">
- {SDKS.map(({ icon: Icon, iconClassName, title, href }) => (
- <ContentLinkCard
- key={href}
- href={createHref(href, domain, {
- utm_source: "Custom Domain",
- utm_medium: "Navbar",
- utm_campaign: domain,
- utm_content: title,
- })}
- icon={
- <Icon
- className={cn(
- "h-5 w-5 shrink-0 text-gray-600 transition-colors dark:text-white/60",
- iconClassName,
- )}
- />
- }
- title={title}
- showArrow
- />
- ))}
- </div>
- </div>
</div>
);
}
diff --git a/packages/ui/src/nav/nav.tsx b/packages/ui/src/nav/nav.tsx
index 7267579d10..b97c143b94 100644
--- a/packages/ui/src/nav/nav.tsx
+++ b/packages/ui/src/nav/nav.tsx
@@ -14,13 +14,12 @@ import Link from "next/link";
import { useParams, useSelectedLayoutSegment } from "next/navigation";
import { PropsWithChildren, createContext } from "react";
import useSWR from "swr";
-import { FEATURES_LIST, RESOURCES, SDKS } from "../content";
+import { FEATURES_LIST, RESOURCES } from "../content";
import { useScroll } from "../hooks";
import { MaxWidthWrapper } from "../max-width-wrapper";
import { NavLogo } from "../nav-logo";
import { ProductContent } from "./content/product-content";
import { ResourcesContent } from "./content/resources-content";
-import { SolutionsContent } from "./content/solutions-content";
export type NavTheme = "light" | "dark";
@@ -35,9 +34,9 @@ export const navItems = [
childItems: FEATURES_LIST,
},
{
- name: "Solutions",
- content: SolutionsContent,
- childItems: SDKS,
+ name: "Resources",
+ content: ResourcesContent,
+ childItems: RESOURCES,
},
{
name: "Customers",
@@ -47,11 +46,6 @@ export const navItems = [
name: "Pricing",
href: "/pricing",
},
- {
- name: "Resources",
- content: ResourcesContent,
- childItems: RESOURCES,
- },
];
const navItemStyles = cva(