Skip to content

Commit 6d741ca

Browse files
authored
feat: DR-7392 Add navigation menu for website/blog (#7533)
* Add navigation menu for website/blog * Add fonts in DS Add hooks for GH stargazer and scroll threshold Update button Update blog layout with navbar * Update md breaking point Update blog layout for mobile * update top * Update navigation menu states * update navigation menu * Update import for navigation * first stage of nav menu mobile * Add website mobile * Add overflow fixture * Update rounded corners for md * Update layout Update dropdown * Update rounded on menu item * Update color of icon * Update navigation-menu overflow scroll * update triggers
1 parent 38a57c9 commit 6d741ca

17 files changed

Lines changed: 811 additions & 40 deletions

File tree

Lines changed: 99 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,112 @@
1-
import { HomeLayout } from 'fumadocs-ui/layouts/home';
2-
import { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
3-
export function baseOptions(): BaseLayoutProps {
1+
import { WebNavigation } from "@prisma-docs/ui/components/web-navigation";
2+
export function baseOptions() {
43
return {
54
nav: {
6-
title: 'My App',
5+
title: "My App",
76
},
87
links: [
98
{
10-
url: '/docs',
11-
text: 'Docs',
9+
text: "Products",
10+
sub: [
11+
{
12+
text: "Postgres",
13+
url: "/postgres",
14+
desc: "Managed Postgres for global workloads",
15+
icon: "fa-regular fa-chart-pyramid",
16+
},
17+
{
18+
text: "ORM",
19+
url: "/orm",
20+
desc: "Managed Postgres for global workloads",
21+
icon: "fa-regular fa-database",
22+
},
23+
{
24+
text: "Studio",
25+
icon: "fa-regular fa-table",
26+
url: "/studio",
27+
desc: "Explore and manipulate your data",
28+
},
29+
{
30+
icon: "fa-regular fa-bolt",
31+
text: "Accelerate",
32+
desc: "Make your database global",
33+
url: "/accelerate",
34+
},
35+
{
36+
icon: "fa-regular fa-plug",
37+
text: "Management API",
38+
desc: "Offer Postgres to your users",
39+
url: "/",
40+
},
41+
],
1242
},
1343
{
14-
url: '/blog',
15-
text: 'Blog',
44+
url: "/pricing",
45+
text: "Pricing",
46+
},
47+
{
48+
text: "Resources",
49+
col: 2,
50+
sub: [
51+
{
52+
text: "MCP",
53+
url: "/mcp",
54+
icon: "fa-regular fa-message-code",
55+
},
56+
{
57+
text: "Get started",
58+
url: "/docs",
59+
icon: "fa-regular fa-book-open",
60+
},
61+
{
62+
text: "Tutorials",
63+
url: "/learn",
64+
icon: "fa-regular fa-clapperboard-play",
65+
},
66+
{
67+
text: "Examples",
68+
url: "/",
69+
icon: "fa-regular fa-grid-2",
70+
},
71+
{
72+
text: "Stack",
73+
url: "/stack",
74+
icon: "fa-regular fa-layer-group",
75+
},
76+
{
77+
text: "Ecosystem",
78+
url: "/ecosystem",
79+
icon: "fa-regular fa-globe",
80+
},
81+
{
82+
text: "Customer stories",
83+
url: "/",
84+
icon: "fa-regular fa-users",
85+
},
86+
{
87+
text: "Data guide",
88+
url: "/dataguide",
89+
icon: "fa-regular fa-file-binary",
90+
},
91+
],
92+
},
93+
{
94+
url: "/partners",
95+
text: "Partners",
96+
},
97+
{
98+
url: "/blog",
99+
text: "Blog",
16100
},
17101
],
18102
};
19103
}
20104

21-
export default function Layout({ children, }: { children: React.ReactNode; }) {
22-
return <HomeLayout {...baseOptions()}>{children}</HomeLayout>;
105+
export default function Layout({ children }: { children: React.ReactNode }) {
106+
return (
107+
<>
108+
<WebNavigation links={baseOptions().links} />
109+
{children}
110+
</>
111+
);
23112
}

apps/blog/src/app/layout.tsx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
1-
import { RootProvider } from 'fumadocs-ui/provider/next';
2-
import './global.css';
3-
import { Inter, Barlow } from 'next/font/google';
1+
import { RootProvider } from "fumadocs-ui/provider/next";
2+
import "./global.css";
3+
import { Inter, Barlow } from "next/font/google";
4+
import Script from "next/script";
45

56
const inter = Inter({
6-
subsets: ['latin'],
7-
variable: '--font-inter',
7+
subsets: ["latin"],
8+
variable: "--font-inter",
89
});
910

1011
const barlow = Barlow({
11-
subsets: ['latin'],
12-
weight: ['400', '500', '600', '700'],
13-
variable: '--font-barlow',
12+
subsets: ["latin"],
13+
weight: ["400", "500", "600", "700"],
14+
variable: "--font-barlow",
1415
});
1516

16-
export default function Layout({ children }: LayoutProps<'/'>) {
17+
export default function Layout({ children }: LayoutProps<"/">) {
1718
return (
1819
<html
1920
lang="en"
2021
className={`${inter.variable} ${barlow.variable}`}
2122
suppressHydrationWarning
2223
>
23-
<head></head>
24+
<head>
25+
<Script
26+
src="https://kit.fontawesome.com/6916e9db27.js"
27+
crossOrigin="anonymous"
28+
></Script>
29+
</head>
2430
<body className="flex flex-col min-h-screen">
2531
<RootProvider>{children}</RootProvider>
2632
</body>

packages/eclipse/src/components/action.tsx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,27 @@ const actionVariants = cva(
88
{
99
variants: {
1010
color: {
11-
ppg: "bg-background-ppg",
12-
orm: "bg-background-orm",
13-
error: "bg-background-error",
14-
success: "bg-background-success",
15-
warning: "bg-background-warning",
16-
cyan: "bg-background-cyan",
17-
fuchsia: "bg-background-fuchsia",
18-
lime: "bg-background-lime",
19-
pink: "bg-background-pink",
20-
purple: "bg-background-purple",
21-
sky: "bg-background-sky",
22-
violet: "bg-background-violet",
23-
yellow: "bg-background-yellow",
24-
neutral: "bg-background-neutral",
25-
"neutral-reversed": "bg-background-neutral-reverse",
11+
ppg: "bg-background-ppg text-foreground-ppg",
12+
orm: "bg-background-orm text-foreground-orm",
13+
error: "bg-background-error text-foreground-error",
14+
success: "bg-background-success text-foreground-success",
15+
warning: "bg-background-warning text-foreground-warning",
16+
cyan: "bg-background-cyan text-foreground-cyan",
17+
fuchsia: "bg-background-fuchsia text-foreground-fuchsia",
18+
lime: "bg-background-lime text-foreground-lime",
19+
pink: "bg-background-pink text-foreground-pink",
20+
purple: "bg-background-purple text-foreground-purple",
21+
sky: "bg-background-sky text-foreground-sky",
22+
violet: "bg-background-violet text-foreground-violet",
23+
yellow: "bg-background-yellow text-foreground-yellow",
24+
neutral: "bg-background-neutral text-foreground-neutral",
25+
"neutral-reversed":
26+
"bg-background-neutral-reverse text-foreground-neutral-reverse",
2627
},
2728
size: {
2829
lg: "h-7 w-7 p-1.5",
2930
"2xl": "h-9 w-9 p-2",
31+
nav: "h-10 w-10 p-2.5",
3032
"4xl": "h-12 w-12 p-3",
3133
"5xl": "h-16 w-16 p-4",
3234
},

packages/eclipse/src/components/button.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ import * as React from "react";
22
import { cva, type VariantProps } from "class-variance-authority";
33
import { cn } from "../lib/cn";
44

5-
const buttonVariants = cva("border", {
5+
const buttonVariants = cva("", {
66
variants: {
77
variant: {
88
ppg: "bg-background-ppg-reverse text-foreground-ppg-reverse hover:bg-background-ppg-reverse-strong",
99
orm: "bg-background-orm-reverse text-foreground-orm-reverse hover:bg-background-orm-reverse-strong",
1010
default:
11-
"bg-background-default border-stroke-neutral text-foreground-neutral",
11+
"bg-background-default border border-stroke-neutral text-foreground-neutral",
1212
"default-stronger":
13-
"bg-background-neutral border-stroke-neutral text-foreground-neutral hover:bg-background-neutral-strong",
13+
"bg-background-neutral text-foreground-neutral hover:bg-background-neutral-strong",
1414
"default-weaker": "bg-background-neutral text-foreground-neutral-weaker",
1515
error:
1616
"bg-background-error-reverse text-foreground-error-reverse hover:bg-backΩground-error-reverse-strong focus-visible:ring-stroke-error",
351 KB
Binary file not shown.
269 KB
Binary file not shown.

packages/eclipse/src/styles/globals.css

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
@source "../components/**/*.tsx";
44
@source "../components/ui/**/*.tsx";
55

6+
@font-face {
7+
font-family: "Monaspace Neon Var";
8+
src:
9+
url("../static/fonts/monaspace_neon_var.woff") format("woff"),
10+
url("../static/fonts/monaspace_neon_var.woff2") format("woff2");
11+
}
12+
613
@theme {
714
/* Box Shadow */
815
--shadow-drop-low: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
@@ -75,7 +82,7 @@
7582
--font-family-display: var(--font-mona-sans), Inter, sans-serif;
7683
--font-family-sans-display: Inter, sans-serif;
7784
--font-family-sans: Inter, system-ui, sans-serif;
78-
--font-family-mono: Jetbrains Mono, monospace;
85+
--font-family-mono: Monaspace Neon Var;
7986

8087
/* Tailwind Font Family Mappings */
8188
--font-display: var(--font-mona-sans), Inter, sans-serif;

packages/eclipse/src/tokens/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export const typography = {
235235
fontFamily: {
236236
"sans-display": "Inter",
237237
sans: "Inter",
238-
monospace: "Jetbrains Mono",
238+
monospace: "Monaspace Neon Var",
239239
},
240240
fontSize: {
241241
"2xs": 11,

packages/ui/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"dependencies": {
1818
"@base-ui/react": "catalog:",
19+
"@prisma-docs/eclipse": "workspace:*",
1920
"class-variance-authority": "catalog:",
2021
"clsx": "catalog:",
2122
"feed": "catalog:",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
"use client";
2+
export function FontAwesomeScript() {
3+
return (
4+
<script
5+
//WEB COMPONENTS FONTAWESOME
6+
src="https://kit.fontawesome.com/ad485975d2.js"
7+
cross-origin="anonymous"
8+
async
9+
/>
10+
);
11+
}

0 commit comments

Comments
 (0)