Skip to content

Commit ca37774

Browse files
Move Clerk proxy into src
1 parent 9715aa3 commit ca37774

4 files changed

Lines changed: 66 additions & 17 deletions

File tree

middleware.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/app/globals.css

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,36 @@ body {
3535
font-family: var(--font-display), sans-serif;
3636
}
3737

38+
.site-header {
39+
position: sticky;
40+
top: 0;
41+
z-index: 20;
42+
backdrop-filter: blur(16px);
43+
background: rgba(5, 16, 23, 0.72);
44+
border-bottom: 1px solid rgba(143, 211, 199, 0.12);
45+
}
46+
47+
.site-header-inner {
48+
width: min(1440px, calc(100vw - 32px));
49+
margin: 0 auto;
50+
min-height: 72px;
51+
display: flex;
52+
align-items: center;
53+
justify-content: space-between;
54+
}
55+
56+
.site-brand {
57+
font-weight: 700;
58+
letter-spacing: -0.04em;
59+
font-size: 1.1rem;
60+
}
61+
62+
.site-auth-actions {
63+
display: flex;
64+
align-items: center;
65+
gap: 12px;
66+
}
67+
3868
button,
3969
input,
4070
textarea,

src/app/layout.tsx

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { Metadata } from "next";
2-
import { ClerkProvider } from "@clerk/nextjs";
2+
import { ClerkProvider, SignInButton, SignUpButton, UserButton } from "@clerk/nextjs";
3+
import { auth } from "@clerk/nextjs/server";
34
import { IBM_Plex_Mono, Space_Grotesk } from "next/font/google";
45

56
import "./globals.css";
@@ -20,13 +21,34 @@ export const metadata: Metadata = {
2021
description: "Agent-native code forge with autonomous repositories, pull requests, governance, and live event streaming.",
2122
};
2223

23-
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
24-
const publishableKey = process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY;
24+
export default async function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
25+
const { userId } = await auth();
2526

2627
return (
2728
<html lang="en">
2829
<body className={`${display.variable} ${mono.variable}`}>
29-
{publishableKey ? <ClerkProvider publishableKey={publishableKey}>{children}</ClerkProvider> : children}
30+
<ClerkProvider>
31+
<header className="site-header">
32+
<div className="site-header-inner">
33+
<div className="site-brand">agentgithub</div>
34+
<div className="site-auth-actions">
35+
{userId ? (
36+
<UserButton afterSignOutUrl="/" />
37+
) : (
38+
<>
39+
<SignInButton mode="modal">
40+
<button className="ghost-button" type="button">Sign in</button>
41+
</SignInButton>
42+
<SignUpButton mode="modal">
43+
<button className="action-button inline-action" type="button">Sign up</button>
44+
</SignUpButton>
45+
</>
46+
)}
47+
</div>
48+
</div>
49+
</header>
50+
{children}
51+
</ClerkProvider>
3052
</body>
3153
</html>
3254
);

src/proxy.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { clerkMiddleware } from "@clerk/nextjs/server";
2+
3+
export default clerkMiddleware();
4+
5+
export const config = {
6+
matcher: [
7+
"/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)",
8+
"/(api|trpc)(.*)",
9+
],
10+
};

0 commit comments

Comments
 (0)