File tree Expand file tree Collapse file tree 10 files changed +363
-39
lines changed Expand file tree Collapse file tree 10 files changed +363
-39
lines changed Original file line number Diff line number Diff line change
1
+ import React from "react" ;
2
+
3
+ const Layout = ( { children } : { children : React . ReactNode } ) => {
4
+ return (
5
+ < main className = "flex min-h-screen w-full items-center justify-center" >
6
+ { children }
7
+ </ main >
8
+ ) ;
9
+ } ;
10
+
11
+ export default Layout ;
Original file line number Diff line number Diff line change
1
+ import { SignIn } from "@clerk/nextjs" ;
2
+
3
+ export default function Page ( ) {
4
+ return < SignIn /> ;
5
+ }
Original file line number Diff line number Diff line change
1
+ import { SignUp } from "@clerk/nextjs" ;
2
+
3
+ export default function Page ( ) {
4
+ return < SignUp /> ;
5
+ }
Original file line number Diff line number Diff line change
1
+ "use client" ;
2
+
3
+ import { UserButton } from "@clerk/nextjs" ;
4
+
5
+ const DotIcon = ( ) => {
6
+ return (
7
+ < svg
8
+ xmlns = "http://www.w3.org/2000/svg"
9
+ viewBox = "0 0 512 512"
10
+ fill = "currentColor"
11
+ >
12
+ < path d = "M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z" />
13
+ </ svg >
14
+ ) ;
15
+ } ;
16
+
17
+ export default function Home ( ) {
18
+ return (
19
+ < header >
20
+ < UserButton >
21
+ < UserButton . MenuItems >
22
+ < UserButton . Action
23
+ label = "Open chat"
24
+ labelIcon = { < DotIcon /> }
25
+ onClick = { ( ) => alert ( "init chat" ) }
26
+ />
27
+ </ UserButton . MenuItems >
28
+ </ UserButton >
29
+ </ header >
30
+ ) ;
31
+ }
Original file line number Diff line number Diff line change
1
+ import React from "react" ;
2
+
3
+ const page = ( ) => {
4
+ return < div > Ask Question</ div > ;
5
+ } ;
6
+
7
+ export default page ;
Original file line number Diff line number Diff line change 1
- import type { Metadata } from "next" ;
2
- import localFont from "next/font/local" ;
1
+ import {
2
+ ClerkProvider ,
3
+ SignInButton ,
4
+ SignedIn ,
5
+ SignedOut ,
6
+ UserButton ,
7
+ } from "@clerk/nextjs" ;
3
8
import "./globals.css" ;
4
-
5
- const geistSans = localFont ( {
6
- src : "./fonts/GeistVF.woff" ,
7
- variable : "--font-geist-sans" ,
8
- weight : "100 900" ,
9
- } ) ;
10
- const geistMono = localFont ( {
11
- src : "./fonts/GeistMonoVF.woff" ,
12
- variable : "--font-geist-mono" ,
13
- weight : "100 900" ,
14
- } ) ;
15
-
16
- export const metadata : Metadata = {
17
- title : "Create Next App" ,
18
- description : "Generated by create next app" ,
19
- } ;
20
-
21
9
export default function RootLayout ( {
22
10
children,
23
- } : Readonly < {
11
+ } : {
24
12
children : React . ReactNode ;
25
- } > ) {
13
+ } ) {
26
14
return (
27
- < html lang = "en" >
28
- < body
29
- className = { `${ geistSans . variable } ${ geistMono . variable } antialiased` }
30
- >
31
- { children }
32
- </ body >
33
- </ html >
15
+ < ClerkProvider >
16
+ < html lang = "en" >
17
+ < body > { children } </ body >
18
+ </ html >
19
+ </ ClerkProvider >
34
20
) ;
35
21
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ import { clerkMiddleware , createRouteMatcher } from "@clerk/nextjs/server" ;
2
+
3
+ const isPublicRoute = createRouteMatcher ( [ "/sign-in(.*)" , "/sign-up(.*)" ] ) ;
4
+
5
+ export default clerkMiddleware ( ( auth , request ) => {
6
+ if ( ! isPublicRoute ( request ) ) {
7
+ auth ( ) . protect ( ) ;
8
+ }
9
+ } ) ;
10
+
11
+ export const config = {
12
+ matcher : [
13
+ // Skip Next.js internals and all static files, unless found in search params
14
+ "/((?!_next|[^?]*\\.(?:html?|css|js(?!on)|jpe?g|webp|png|gif|svg|ttf|woff2?|ico|csv|docx?|xlsx?|zip|webmanifest)).*)" ,
15
+ // Always run for API routes
16
+ "/(api|trpc)(.*)" ,
17
+ ] ,
18
+ } ;
You can’t perform that action at this time.
0 commit comments