Skip to content

Commit 1a8cd99

Browse files
feat: reference geist from google fonts (#876)
1 parent d26e0d9 commit 1a8cd99

File tree

10 files changed

+73
-75
lines changed

10 files changed

+73
-75
lines changed

app/(auth)/login/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default function Page() {
3838
setIsSuccessful(true);
3939
router.refresh();
4040
}
41-
}, [state.status, router]);
41+
}, [state.status]);
4242

4343
const handleSubmit = (formData: FormData) => {
4444
setEmail(formData.get('email') as string);

app/(auth)/register/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function Page() {
3939
setIsSuccessful(true);
4040
router.refresh();
4141
}
42-
}, [state, router]);
42+
}, [state]);
4343

4444
const handleSubmit = (formData: FormData) => {
4545
setEmail(formData.get('email') as string);

app/(chat)/layout.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { cookies } from 'next/headers';
22

33
import { AppSidebar } from '@/components/app-sidebar';
44
import { SidebarInset, SidebarProvider } from '@/components/ui/sidebar';
5-
65
import { auth } from '../(auth)/auth';
76
import Script from 'next/script';
87

app/globals.css

-14
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,6 @@
102102
body {
103103
@apply bg-background text-foreground;
104104
}
105-
106-
@font-face {
107-
font-family: "geist";
108-
font-style: normal;
109-
font-weight: 100 900;
110-
src: url(/fonts/geist.woff2) format("woff2");
111-
}
112-
113-
@font-face {
114-
font-family: "geist-mono";
115-
font-style: normal;
116-
font-weight: 100 900;
117-
src: url(/fonts/geist-mono.woff2) format("woff2");
118-
}
119105
}
120106

121107
.skeleton {

app/layout.tsx

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { Metadata } from 'next';
21
import { Toaster } from 'sonner';
3-
2+
import type { Metadata } from 'next';
3+
import { Geist, Geist_Mono } from 'next/font/google';
44
import { ThemeProvider } from '@/components/theme-provider';
55

66
import './globals.css';
@@ -15,6 +15,18 @@ export const viewport = {
1515
maximumScale: 1, // Disable auto-zoom on mobile Safari
1616
};
1717

18+
const geist = Geist({
19+
subsets: ['latin'],
20+
display: 'swap',
21+
variable: '--font-geist',
22+
});
23+
24+
const geistMono = Geist_Mono({
25+
subsets: ['latin'],
26+
display: 'swap',
27+
variable: '--font-geist-mono',
28+
});
29+
1830
const LIGHT_THEME_COLOR = 'hsl(0 0% 100%)';
1931
const DARK_THEME_COLOR = 'hsl(240deg 10% 3.92%)';
2032
const THEME_COLOR_SCRIPT = `\
@@ -48,6 +60,7 @@ export default async function RootLayout({
4860
// prop is necessary to avoid the React hydration mismatch warning.
4961
// https://github.com/pacocoursey/next-themes?tab=readme-ov-file#with-app
5062
suppressHydrationWarning
63+
className={`${geist.variable} ${geistMono.variable}`}
5164
>
5265
<head>
5366
<script
@@ -56,7 +69,7 @@ export default async function RootLayout({
5669
}}
5770
/>
5871
</head>
59-
<body className="">
72+
<body className="antialiased">
6073
<ThemeProvider
6174
attribute="class"
6275
defaultTheme="system"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"geist": "^1.3.1",
5656
"lucide-react": "^0.446.0",
5757
"nanoid": "^5.0.8",
58-
"next": "15.2.2-canary.1",
58+
"next": "15.3.0-canary.12",
5959
"next-auth": "5.0.0-beta.25",
6060
"next-themes": "^0.3.0",
6161
"orderedmap": "^2.1.1",

pnpm-lock.yaml

+50-50
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/fonts/geist-mono.woff2

-60.8 KB
Binary file not shown.

public/fonts/geist.woff2

-61.1 KB
Binary file not shown.

tailwind.config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ const config: Config = {
88
'./app/**/*.{js,ts,jsx,tsx,mdx}',
99
],
1010
theme: {
11-
fontFamily: {
12-
sans: ['geist'],
13-
mono: ['geist-mono'],
14-
},
1511
extend: {
12+
fontFamily: {
13+
sans: ['var(--font-geist)'],
14+
mono: ['var(--font-geist-mono)'],
15+
},
1616
screens: {
1717
'toast-mobile': '600px',
1818
},

0 commit comments

Comments
 (0)