Skip to content

Commit

Permalink
Add Company to nav
Browse files Browse the repository at this point in the history
  • Loading branch information
TWilson023 committed Jan 15, 2025
1 parent fa976f7 commit c33c747
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 24 deletions.
66 changes: 54 additions & 12 deletions packages/ui/src/content.ts
Original file line number Diff line number Diff line change
@@ -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 = [
{
Expand Down Expand Up @@ -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",
Expand All @@ -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" },
Expand All @@ -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",
},
];
20 changes: 20 additions & 0 deletions packages/ui/src/icons/nucleo/heart-fill.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { SVGProps } from "react";

export function HeartFill(props: SVGProps<SVGSVGElement>) {
return (
<svg
height="18"
width="18"
viewBox="0 0 18 18"
xmlns="http://www.w3.org/2000/svg"
{...props}
>
<g fill="currentColor">
<path
d="M12.164,2c-1.195,.015-2.324,.49-3.164,1.306-.84-.815-1.972-1.291-3.178-1.306-2.53,.015-4.582,2.084-4.572,4.609,0,5.253,5.306,8.429,6.932,9.278,.256,.133,.537,.2,.818,.2s.562-.067,.817-.2c1.626-.848,6.933-4.024,6.933-9.275,.009-2.528-2.042-4.597-4.586-4.612Z"
fill="currentColor"
/>
</g>
</svg>
);
}
1 change: 1 addition & 0 deletions packages/ui/src/icons/nucleo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
46 changes: 46 additions & 0 deletions packages/ui/src/nav/content/company-content.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className="grid w-[540px] grid-cols-[minmax(0,1fr),minmax(0,0.75fr)]">
<div className="flex flex-col gap-4 border-r border-neutral-200 p-4">
{COMPANY.map(({ title, description, icon, href }) => (
<LargeLinkCard
key={title}
title={title}
description={description}
descriptionClassName="mt-0.5"
icon={icon}
iconClassName="size-5"
href={createHref(href, domain)}
/>
))}
</div>
<div className="px-6 py-4">
<p className={cn(contentHeadingClassName, "mb-2")}>Social</p>
<div className="grid grid-cols-1">
{SOCIAL_LINKS.map(({ icon: Icon, name, href }) => (
<ContentLinkCard
key={href}
href={href}
target="_blank"
className="-mx-2"
icon={
<div className="shrink-0 rounded-lg border border-neutral-200 bg-white/50 p-1.5 dark:border-white/20 dark:bg-white/10">
<Icon className="size-4 shrink-0 text-neutral-600 transition-colors dark:text-white/60" />
</div>
}
title={name}
/>
))}
</div>
</div>
</div>
);
}
2 changes: 1 addition & 1 deletion packages/ui/src/nav/content/product-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const largeLinks = [

export function ProductContent({ domain }: { domain: string }) {
return (
<div className="grid w-[1020px] grid-cols-[repeat(2,minmax(0,1fr)),0.8fr] gap-4 p-5">
<div className="grid w-[1020px] grid-cols-[repeat(2,minmax(0,1fr)),0.8fr] gap-4 p-4">
<Link
href={createHref("/home", 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"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/nav/content/resources-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const mainLinks = [

export function ResourcesContent({ domain }: { domain: string }) {
return (
<div className="grid w-[1020px] grid-cols-[repeat(2,minmax(0,1fr)),0.8fr] gap-4 p-5">
<div className="grid w-[1020px] grid-cols-[repeat(2,minmax(0,1fr)),0.8fr] gap-4 p-4">
{mainLinks.map(({ title, description, thumbnail, href }) => (
<Link
key={title}
Expand Down
24 changes: 19 additions & 5 deletions packages/ui/src/nav/content/shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ComponentProps, ReactNode, SVGProps } from "react";
import { ExpandingArrow, Icon } from "../../icons";

export const contentHeadingClassName =
"text-xs uppercase text-neutral-400 dark:text-white/60";
"text-xs uppercase text-neutral-500 dark:text-white/60";

export const contentLinkCardClassName =
"group rounded-[8px] p-2 transition-colors hover:bg-neutral-50 active:bg-neutral-100 dark:hover:bg-white/[0.15] dark:active:bg-white/20";
Expand Down Expand Up @@ -87,27 +87,41 @@ export function LargeLinkCard({
icon: Icon,
title,
description,
descriptionClassName,
iconClassName,
...rest
}: {
icon: Icon;
title: string;
description?: string;
descriptionClassName?: string;
iconClassName?: string;
} & ComponentProps<typeof Link>) {
return (
<Link
{...rest}
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"
className="group relative flex flex-col justify-center 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>
<span className="text-sm font-medium leading-none text-neutral-900 dark:text-white">
<span className="block text-sm font-medium leading-none text-neutral-900 dark:text-white">
{title}
</span>
<p className="mt-1 text-sm text-neutral-500 dark:text-white/60">
<p
className={cn(
"mt-1.5 text-sm text-neutral-500 dark:text-white/60",
descriptionClassName,
)}
>
{description}
</p>
</div>
<Icon className="size-6 text-neutral-700 dark:text-neutral-200" />
<Icon
className={cn(
"size-6 text-neutral-700 dark:text-neutral-200",
iconClassName,
)}
/>
</div>
</Link>
);
Expand Down
12 changes: 7 additions & 5 deletions packages/ui/src/nav/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand All @@ -33,17 +34,18 @@ export const navItems = [
name: "Resources",
content: ResourcesContent,
childItems: RESOURCES,
segments: ["/solutions", "/blog", "/changelog", "/docs", "/help", "/brand"],
segments: ["/solutions", "/docs", "/help", "/brand"],
},
{
name: "Enterprise",
href: "/enterprise",
segments: ["/enterprise"],
},
{
name: "Customers",
href: "/customers",
segments: ["/customers"],
name: "Company",
content: CompanyContent,
childItems: COMPANY,
segments: ["about", "/blog", "/changelog", "/customers"],
},
{
name: "Pricing",
Expand Down

0 comments on commit c33c747

Please sign in to comment.