11"use client" ;
2+ import { useClerk } from "@clerk/clerk-react" ;
23import * as Clerk from "@clerk/elements/common" ;
34import * as ClerkSignUp from "@clerk/elements/sign-up" ;
45import { faGithub , faGoogle , faSpinnerThird , Icon } from "@rivet-gg/icons" ;
56import { Link } from "@tanstack/react-router" ;
67import { motion } from "framer-motion" ;
7- import { cn } from "@/components" ;
8+ import { Badge , cn , Skeleton } from "@/components" ;
89import { Button } from "@/components/ui/button" ;
910import {
1011 Card ,
@@ -18,14 +19,58 @@ import { Input } from "@/components/ui/input";
1819import { Label } from "@/components/ui/label" ;
1920
2021export function SignUp ( ) {
22+ const clerk = useClerk ( ) ;
2123 return (
2224 < motion . div
2325 className = "grid w-full grow items-center px-4 sm:justify-center"
2426 initial = { { opacity : 0 , y : 10 } }
2527 animate = { { opacity : 1 , y : 0 } }
2628 exit = { { opacity : 0 , y : 10 } }
2729 >
28- < ClerkSignUp . Root routing = "virtual" >
30+ < ClerkSignUp . Root
31+ routing = "virtual"
32+ path = "/"
33+ fallback = {
34+ < Card className = "w-full sm:w-96" >
35+ < CardHeader >
36+ < CardTitle > Welcome!</ CardTitle >
37+ < CardDescription >
38+ Enter your email below to login to your account.
39+ </ CardDescription >
40+ </ CardHeader >
41+ < CardContent className = "grid gap-y-4" >
42+ < div className = "grid grid-cols-2 gap-4" >
43+ < Skeleton className = "h-10 w-full" />
44+ < Skeleton className = "h-10 w-full" />
45+ </ div >
46+ < p className = "flex items-center gap-x-3 text-sm text-muted-foreground before:h-px before:flex-1 before:bg-border after:h-px after:flex-1 after:bg-border" >
47+ or
48+ </ p >
49+ < div className = "space-y-2" >
50+ < Label > Email address</ Label >
51+ < Input disabled placeholder = "you@company.com" />
52+ </ div >
53+ < div className = "space-y-2" >
54+ < Label > Password</ Label >
55+ < Input disabled placeholder = "Your password" />
56+ </ div >
57+ </ CardContent >
58+ < CardFooter >
59+ < div className = "grid w-full gap-y-4" >
60+ < Skeleton className = "h-10 w-full" />
61+ < Button
62+ variant = "link"
63+ size = "sm"
64+ disabled
65+ className = "text-primary-foreground"
66+ >
67+ Already have an account? Sign in
68+ </ Button >
69+ </ div >
70+ </ CardFooter >
71+ </ Card >
72+ }
73+ >
2974 < Clerk . Loading >
3075 { ( isGlobalLoading ) => (
3176 < >
@@ -71,6 +116,13 @@ export function SignUp() {
71116 )
72117 }
73118 </ Clerk . Loading >
119+ { clerk . client
120+ . lastAuthenticationStrategy ===
121+ "oauth_github" ? (
122+ < Badge className = "ml-2 absolute -top-1/2 -right-4 text-xs" >
123+ Last used
124+ </ Badge >
125+ ) : null }
74126 </ Button >
75127 </ Clerk . Connection >
76128 < Clerk . Connection
@@ -104,6 +156,14 @@ export function SignUp() {
104156 )
105157 }
106158 </ Clerk . Loading >
159+
160+ { clerk . client
161+ . lastAuthenticationStrategy ===
162+ "oauth_google" ? (
163+ < Badge className = "ml-2 absolute -top-1/2 -right-4 text-xs" >
164+ Last used
165+ </ Badge >
166+ ) : null }
107167 </ Button >
108168 </ Clerk . Connection >
109169 </ div >
@@ -174,7 +234,7 @@ export function SignUp() {
174234 asChild
175235 className = "text-primary-foreground"
176236 >
177- < Link to = "/" >
237+ < Link to = "/login " >
178238 Already have an account?
179239 Sign in
180240 </ Link >
0 commit comments