From c33c7472903f12d3d70e775448c059ad1b243ca1 Mon Sep 17 00:00:00 2001 From: Tim Wilson Date: Wed, 15 Jan 2025 14:24:49 -0500 Subject: [PATCH] Add Company to nav --- packages/ui/src/content.ts | 66 +++++++++++++++---- packages/ui/src/icons/nucleo/heart-fill.tsx | 20 ++++++ packages/ui/src/icons/nucleo/index.ts | 1 + .../ui/src/nav/content/company-content.tsx | 46 +++++++++++++ .../ui/src/nav/content/product-content.tsx | 2 +- .../ui/src/nav/content/resources-content.tsx | 2 +- packages/ui/src/nav/content/shared.tsx | 24 +++++-- packages/ui/src/nav/nav.tsx | 12 ++-- 8 files changed, 149 insertions(+), 24 deletions(-) create mode 100644 packages/ui/src/icons/nucleo/heart-fill.tsx create mode 100644 packages/ui/src/nav/content/company-content.tsx diff --git a/packages/ui/src/content.ts b/packages/ui/src/content.ts index 472ed486e0..1b6923c836 100644 --- a/packages/ui/src/content.ts +++ b/packages/ui/src/content.ts @@ -1,20 +1,28 @@ import { Book2Fill, + BulletListFill, ConnectedDotsFill, CubeSettingsFill, + FeatherFill, + Github, Go, HeadsetFill, + HeartFill, HexadecagonStar, Hyperlink, LinesY, + LinkedIn, Php, ProductHunt, Python, Raycast, Ruby, + Twitter, Typescript, + YouTube, } from "./icons"; import { Elxo } from "./icons/elxo"; +import { Logo } from "./logo"; export const FEATURES_LIST = [ { @@ -104,18 +112,6 @@ export const SDKS = [ ]; export const RESOURCES = [ - // { - // icon: FeatherFill, - // title: "Blog", - // description: "Insights and stories", - // href: "/blog", - // }, - // { - // icon: BulletListFill, - // title: "Changelog", - // description: "Releases and updates", - // href: "/changelog", - // }, { icon: Book2Fill, title: "Docs", @@ -136,6 +132,33 @@ export const RESOURCES = [ }, ]; +export const COMPANY = [ + { + icon: Logo, + title: "About", + description: "Company and team", + href: "/about", + }, + { + icon: FeatherFill, + title: "Blog", + description: "Insights and stories", + href: "/blog", + }, + { + icon: BulletListFill, + title: "Changelog", + description: "Releases and updates", + href: "/changelog", + }, + { + icon: HeartFill, + title: "Customers", + description: "Success stories and use cases", + href: "/customers", + }, +]; + export const COMPARE_PAGES = [ { name: "Bitly", slug: "bitly" }, { name: "Rebrandly", slug: "rebrandly" }, @@ -150,3 +173,22 @@ export const LEGAL_PAGES = [ { name: "Subprocessors", slug: "subprocessors" }, { name: "Report Abuse", slug: "abuse" }, ]; + +export const SOCIAL_LINKS = [ + { name: "X (Twitter)", icon: Twitter, href: "https://x.com/dubdotco" }, + { + name: "LinkedIn", + icon: LinkedIn, + href: "https://www.linkedin.com/company/dubinc", + }, + { + name: "GitHub", + icon: Github, + href: "https://github.com/dubinc/dub", + }, + { + name: "YouTube", + icon: YouTube, + href: "https://www.youtube.com/@dubdotco", + }, +]; diff --git a/packages/ui/src/icons/nucleo/heart-fill.tsx b/packages/ui/src/icons/nucleo/heart-fill.tsx new file mode 100644 index 0000000000..7c959e321f --- /dev/null +++ b/packages/ui/src/icons/nucleo/heart-fill.tsx @@ -0,0 +1,20 @@ +import { SVGProps } from "react"; + +export function HeartFill(props: SVGProps) { + return ( + + + + + + ); +} diff --git a/packages/ui/src/icons/nucleo/index.ts b/packages/ui/src/icons/nucleo/index.ts index efcaab0a54..86f2bc6772 100644 --- a/packages/ui/src/icons/nucleo/index.ts +++ b/packages/ui/src/icons/nucleo/index.ts @@ -95,6 +95,7 @@ export * from "./grid-layout-rows"; export * from "./grid-plus"; export * from "./headset"; export * from "./headset-fill"; +export * from "./heart-fill"; export * from "./hexadecagon-star"; export * from "./hyperlink"; export * from "./icosahedron"; diff --git a/packages/ui/src/nav/content/company-content.tsx b/packages/ui/src/nav/content/company-content.tsx new file mode 100644 index 0000000000..8edf9a3d69 --- /dev/null +++ b/packages/ui/src/nav/content/company-content.tsx @@ -0,0 +1,46 @@ +import { cn, createHref } from "@dub/utils"; +import { COMPANY, SOCIAL_LINKS } from "../../content"; +import { + contentHeadingClassName, + ContentLinkCard, + LargeLinkCard, +} from "./shared"; + +export function CompanyContent({ domain }: { domain: string }) { + return ( +
+
+ {COMPANY.map(({ title, description, icon, href }) => ( + + ))} +
+
+

Social

+
+ {SOCIAL_LINKS.map(({ icon: Icon, name, href }) => ( + + +
+ } + title={name} + /> + ))} +
+
+ + ); +} diff --git a/packages/ui/src/nav/content/product-content.tsx b/packages/ui/src/nav/content/product-content.tsx index dd77a97a4f..16dbc892da 100644 --- a/packages/ui/src/nav/content/product-content.tsx +++ b/packages/ui/src/nav/content/product-content.tsx @@ -27,7 +27,7 @@ const largeLinks = [ export function ProductContent({ domain }: { domain: string }) { return ( -
+
+
{mainLinks.map(({ title, description, thumbnail, href }) => ( ) { return (
- + {title} -

+

{description}

- +
); diff --git a/packages/ui/src/nav/nav.tsx b/packages/ui/src/nav/nav.tsx index 8478da7bd9..ec6fdcad1a 100644 --- a/packages/ui/src/nav/nav.tsx +++ b/packages/ui/src/nav/nav.tsx @@ -9,10 +9,11 @@ import { useParams, usePathname } from "next/navigation"; import { PropsWithChildren, createContext, useId } from "react"; import useSWR from "swr"; import { buttonVariants } from "../button"; -import { FEATURES_LIST, RESOURCES } from "../content"; +import { COMPANY, FEATURES_LIST, RESOURCES } from "../content"; import { useScroll } from "../hooks"; import { MaxWidthWrapper } from "../max-width-wrapper"; import { NavWordmark } from "../nav-wordmark"; +import { CompanyContent } from "./content/company-content"; import { ProductContent } from "./content/product-content"; import { ResourcesContent } from "./content/resources-content"; @@ -33,7 +34,7 @@ export const navItems = [ name: "Resources", content: ResourcesContent, childItems: RESOURCES, - segments: ["/solutions", "/blog", "/changelog", "/docs", "/help", "/brand"], + segments: ["/solutions", "/docs", "/help", "/brand"], }, { name: "Enterprise", @@ -41,9 +42,10 @@ export const navItems = [ segments: ["/enterprise"], }, { - name: "Customers", - href: "/customers", - segments: ["/customers"], + name: "Company", + content: CompanyContent, + childItems: COMPANY, + segments: ["about", "/blog", "/changelog", "/customers"], }, { name: "Pricing",