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 footer

Steven Tey5b735e9855b0
diff --git a/packages/ui/package.json b/packages/ui/package.json
index c1aa1d10be..b933db29dd 100644
--- a/packages/ui/package.json
+++ b/packages/ui/package.json
@@ -1,7 +1,7 @@
{
"name": "@dub/ui",
"description": "UI components for Dub",
- "version": "0.2.56",
+ "version": "0.2.57",
"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 896af1a62d..e1b93a41ba 100644
--- a/packages/ui/src/content.ts
+++ b/packages/ui/src/content.ts
@@ -44,24 +44,28 @@ export type NavItemChildren = (
export const FEATURES_LIST = [
{
+ id: "links",
title: "Dub Links",
description: "Short links with superpowers",
icon: DubLinksIcon,
href: "/links",
},
{
+ id: "partners",
title: "Dub Partners",
description: "Grow your revenue with partnerships",
icon: DubPartnersIcon,
href: "/partners",
},
{
+ id: "analytics",
title: "Dub Analytics",
description: "Powerful real-time analytics",
icon: DubAnalyticsIcon,
href: "/analytics",
},
{
+ id: "api",
title: "Dub API",
description: "Programmatic link creation at scale",
icon: DubApiIcon,
diff --git a/packages/ui/src/footer.tsx b/packages/ui/src/footer.tsx
index 8e29c790fd..cc782f63ce 100644
--- a/packages/ui/src/footer.tsx
+++ b/packages/ui/src/footer.tsx
@@ -1,14 +1,26 @@
"use client";
-import { ALL_TOOLS, cn, createHref } from "@dub/utils";
+import { cn, createHref } from "@dub/utils";
+import { ChevronDown } from "lucide-react";
import Image from "next/image";
import Link from "next/link";
import { useParams } from "next/navigation";
+import { useState } from "react";
import { COMPARE_PAGES, FEATURES_LIST, LEGAL_PAGES } from "./content";
import { DubStatusBadge } from "./dub-status-badge";
-import { Github, LinkedIn, ReferredVia, Twitter, YouTube } from "./icons";
+import {
+ DubProduct,
+ DubProductIcon,
+ Github,
+ LinkedIn,
+ ReferredVia,
+ Twitter,
+ YouTube,
+} from "./icons";
import { MaxWidthWrapper } from "./max-width-wrapper";
+import { MenuItem } from "./menu-item";
import { NavWordmark } from "./nav-wordmark";
+import { Popover } from "./popover";
const socials = [
{
@@ -35,12 +47,14 @@ const socials = [
const navigation = {
product: [
- ...FEATURES_LIST.map(({ title, href }) => ({
- name: title,
- href,
- })),
- { name: "Dub Enterprise", href: "/enterprise" },
- { name: "Pricing", href: "/pricing" },
+ ...FEATURES_LIST.filter(({ title }) => title !== "Dub Integrations").map(
+ ({ id, title, href }) => ({
+ id,
+ name: title,
+ href,
+ }),
+ ),
+ { id: null, name: "Dub Enterprise", href: "/enterprise" },
],
solutions: [
{ name: "Marketing attribution", href: "/analytics" },
@@ -50,37 +64,40 @@ const navigation = {
resources: [
{ name: "Docs", href: "/docs/introduction" },
{ name: "Help Center", href: "/help" },
- { name: "Changelog", href: "/changelog" },
- { name: "Blog", href: "/blog" },
- { name: "Customers", href: "/customers" },
+ { name: "Integrations", href: "/integrations" },
+ { name: "Pricing", href: "/pricing" },
{
name: "Affiliates",
href: "https://partners.dub.co/dub",
target: "_blank",
},
+ ],
+ company: [
{ name: "About", href: "/about" },
+ { name: "Blog", href: "/blog" },
{ name: "Careers", href: "/careers" },
+ { name: "Changelog", href: "/changelog" },
+ { name: "Customers", href: "/customers" },
{ name: "Brand", href: "/brand" },
{ name: "Contact", href: "/contact" },
],
compare: COMPARE_PAGES.map(({ name, slug }) => ({
name,
href: `/compare/${slug}`,
- })),
- legal: LEGAL_PAGES.map(({ name, slug }) => ({
- name,
- href: `/legal/${slug}`,
- })),
- tools: ALL_TOOLS.map(({ name, slug }) => ({
- name,
- href: `/tools/${slug}`,
- })),
+ product: "links",
+ })).concat(
+ ["Rewardful", "PartnerStack", "Tolt"].map((name) => ({
+ name,
+ href: `/help/article/migrating-from-${name.toLowerCase()}`,
+ product: "partners",
+ })),
+ ),
};
const linkListHeaderClassName = "text-sm font-medium text-neutral-900";
const linkListClassName = "flex flex-col mt-2.5 gap-3.5";
const linkListItemClassName =
- "flex items-center gap-1 text-sm text-neutral-500 hover:text-neutral-700 transition-colors duration-75";
+ "flex items-center gap-2 text-sm text-neutral-500 hover:text-neutral-700 transition-colors duration-75";
export function Footer({
staticDomain,
@@ -94,6 +111,8 @@ export function Footer({
domain = staticDomain;
}
+ const [openPopover, setOpenPopover] = useState(false);
+
return (
<MaxWidthWrapper
className={cn(
@@ -152,6 +171,9 @@ export function Footer({
})}
className={linkListItemClassName}
>
+ {item.id && (
+ <DubProductIcon product={item.id as DubProduct} />
+ )}
{item.name}
</Link>
</li>
@@ -192,7 +214,7 @@ export function Footer({
utm_content: item.name,
})}
target={item.target}
- className={linkListItemClassName}
+ className={cn(linkListItemClassName, "gap-1")}
>
{item.name}
{item.target && <ReferredVia className="size-3.5" />}
@@ -205,9 +227,9 @@ export function Footer({
<div className="md:grid md:grid-cols-2">
<div className="grid gap-8">
<div>
- <h3 className={linkListHeaderClassName}>Compare</h3>
+ <h3 className={linkListHeaderClassName}>Company</h3>
<ul role="list" className={linkListClassName}>
- {navigation.compare.map((item) => (
+ {navigation.company.map((item) => (
<li key={item.name}>
<Link
href={createHref(item.href, domain, {
@@ -216,50 +238,57 @@ export function Footer({
utm_campaign: domain,
utm_content: item.name,
})}
- className={linkListItemClassName}
- >
- {item.name}
- </Link>
- </li>
- ))}
- </ul>
- </div>
- <div>
- <h3 className={linkListHeaderClassName}>Legal</h3>
- <ul role="list" className={linkListClassName}>
- {navigation.legal.map((item) => (
- <li key={item.name}>
- <Link
- href={createHref(item.href, domain, {
- utm_source: "Custom Domain",
- utm_medium: "Footer",
- utm_campaign: domain,
- utm_content: item.name,
- })}
- className={linkListItemClassName}
+ className={cn(linkListItemClassName, "gap-1")}
>
{item.name}
</Link>
</li>
))}
<li>
- <a
- href="https://security.dub.co"
- target="_blank"
- rel="noreferrer"
- className={linkListItemClassName}
+ <Popover
+ content={
+ <div className="flex w-screen flex-col gap-1 p-1.5 text-sm focus-visible:outline-none sm:w-auto sm:min-w-[200px]">
+ {LEGAL_PAGES.map((page) => (
+ <MenuItem
+ as={Link}
+ key={page.name}
+ href={createHref(
+ `/legal/${page.slug}`,
+ domain,
+ {
+ utm_source: "Custom Domain",
+ utm_medium: "Footer",
+ utm_campaign: domain,
+ utm_content: page.name,
+ },
+ )}
+ className={cn(
+ linkListItemClassName,
+ "font-normal",
+ )}
+ >
+ {page.name}
+ </MenuItem>
+ ))}
+ </div>
+ }
+ openPopover={openPopover}
+ setOpenPopover={setOpenPopover}
>
- Trust Center <ReferredVia className="size-3.5" />
- </a>
+ <button className={linkListItemClassName}>
+ Legal
+ <ChevronDown className="size-3.5" />
+ </button>
+ </Popover>
</li>
</ul>
</div>
</div>
<div className="mt-10 md:mt-0">
- <h3 className={linkListHeaderClassName}>Tools</h3>
+ <h3 className={linkListHeaderClassName}>Compare</h3>
<ul role="list" className={linkListClassName}>
- {navigation.tools.map((item) => (
+ {navigation.compare.map((item) => (
<li key={item.name}>
<Link
href={createHref(item.href, domain, {
@@ -270,6 +299,7 @@ export function Footer({
})}
className={linkListItemClassName}
>
+ <DubProductIcon product={item.product as DubProduct} />
{item.name}
</Link>
</li>
diff --git a/packages/ui/src/icons/dub-product-icon.tsx b/packages/ui/src/icons/dub-product-icon.tsx
new file mode 100644
index 0000000000..8fae753a7c
--- /dev/null
+++ b/packages/ui/src/icons/dub-product-icon.tsx
@@ -0,0 +1,52 @@
+import { cn } from "@dub/utils";
+import {
+ DubAnalyticsIcon,
+ DubApiIcon,
+ DubLinksIcon,
+ DubPartnersIcon,
+} from "./";
+
+const icons = {
+ links: {
+ icon: DubLinksIcon,
+ className: "text-orange-900 bg-orange-400",
+ },
+ analytics: {
+ icon: DubAnalyticsIcon,
+ className: "text-green-900 bg-green-400",
+ },
+ partners: {
+ icon: DubPartnersIcon,
+ className: "text-purple-900 bg-purple-400",
+ },
+ api: {
+ icon: DubApiIcon,
+ className: "text-neutral-900 bg-neutral-400",
+ },
+};
+
+export type DubProduct = keyof typeof icons;
+
+export function DubProductIcon({
+ product,
+ className,
+ iconClassName,
+}: {
+ product: keyof typeof icons;
+ className?: string;
+ iconClassName?: string;
+}) {
+ const { icon: Icon, className: productClassName } = icons[product];
+
+ return (
+ <span
+ className={cn(
+ "flex size-4 items-center justify-center rounded border border-black/5",
+ productClassName,
+ className,
+ )}
+ >
+ <Icon className={cn("size-2.5", iconClassName)} />
+ </span>
+ );
+}
diff --git a/packages/ui/src/icons/index.tsx b/packages/ui/src/icons/index.tsx
index f33ec2ea8a..d57659e1ef 100644
--- a/packages/ui/src/icons/index.tsx
+++ b/packages/ui/src/icons/index.tsx
@@ -11,6 +11,7 @@ export * from "./dub-api";
export * from "./dub-crafted-shield";
export * from "./dub-links";
export * from "./dub-partners";
+export * from "./dub-product-icon";
export * from "./expanding-arrow";
export * from "./magic";
export * from "./markdown-icon";