@@ -5,6 +5,18 @@ import { signUp } from '@/app/actions/auth-actions';
5
5
import { useRouter } from 'next/navigation' ;
6
6
import Link from 'next/link' ;
7
7
8
+ import { Button } from '@/components/ui/button' ;
9
+ import {
10
+ Card ,
11
+ CardContent ,
12
+ CardFooter ,
13
+ CardHeader ,
14
+ } from '@/components/ui/card' ;
15
+ import { Input } from '@/components/ui/input' ;
16
+ import { Label } from '@/components/ui/label' ;
17
+
18
+ import { UserIcon } from 'lucide-react' ;
19
+
8
20
export default function SignUp ( ) {
9
21
const formRef = useRef < HTMLFormElement > ( null ) ;
10
22
const router = useRouter ( ) ;
@@ -24,65 +36,91 @@ export default function SignUp() {
24
36
< form
25
37
ref = { formRef }
26
38
action = { handleSignUp }
27
- className = "space-y-4 max-w-md mx-auto "
39
+ className = "min-h-screen flex items-center justify-center bg-[url('@/public/loader.svg?height=400 & width = 400 ')] bg-repeat p-4 "
28
40
>
29
- < div >
30
- < label htmlFor = "username" className = "block text-sm font-medium " >
31
- Username
32
- </ label >
33
- < input
34
- type = "text"
35
- name = "username"
36
- id = "username"
37
- required
38
- className = "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
39
- />
40
- </ div >
41
- < div >
42
- < label htmlFor = "password" className = "block text-sm font-medium " >
43
- Password
44
- </ label >
45
- < input
46
- type = "password"
47
- name = "password"
48
- id = "password"
49
- required
50
- className = "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
51
- />
52
- </ div >
53
- < div >
54
- < label htmlFor = "firstName" className = "block text-sm font-medium " >
55
- First Name
56
- </ label >
57
- < input
58
- type = "text"
59
- name = "firstName"
60
- id = "firstName"
61
- required
62
- className = "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
63
- />
64
- </ div >
65
- < div >
66
- < label htmlFor = "lastName" className = "block text-sm font-medium " >
67
- Last Name
68
- </ label >
69
- < input
70
- type = "text"
71
- name = "lastName"
72
- id = "lastName"
73
- required
74
- className = "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50"
75
- />
76
- </ div >
77
- < Link className = " text-indigo-600" href = { '/signin' } >
78
- Already a user? Sign in
79
- </ Link >
80
- < button
81
- type = "submit"
82
- className = "w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
83
- >
84
- Sign Up
85
- </ button >
41
+ <Card className="w-full max-w-md shadow-lg">
42
+ <CardHeader className="space-y-1 flex flex-col items-center">
43
+ <div className="bg-primary text-primary-foreground p-3 rounded-full">
44
+ <UserIcon className="h-6 w-6" />
45
+ </div>
46
+ <h1 className="text-2xl font-bold">Register your account</h1>
47
+ <p className="text-muted-foreground">Enter the following details</p>
48
+ </CardHeader>
49
+ <CardContent className="space-y-4">
50
+ <div className="space-y-2">
51
+ <Label htmlFor="firstName">First Name</Label>
52
+ <Input
53
+ type="text"
54
+ name="firstName"
55
+ id="firstName"
56
+ placeholder="Enter your first name"
57
+ required
58
+ />
59
+ </div>
60
+ <div>
61
+ <Label htmlFor="lastName">Last Name</Label>
62
+ <Input
63
+ type="text"
64
+ name="lastName"
65
+ id="lastName"
66
+ placeholder="Enter your last name"
67
+ required
68
+ />
69
+ </div>
70
+ <div className="space-y-2">
71
+ <Label htmlFor="username">Username</Label>
72
+ <Input
73
+ id="username"
74
+ type="text"
75
+ name="username"
76
+ placeholder="Enter your username"
77
+ required
78
+ />
79
+ </div>
80
+ <div className="space-y-2">
81
+ <Label htmlFor="password">Password</Label>
82
+ <Input
83
+ id="password"
84
+ type="password"
85
+ name="password"
86
+ placeholder="Enter your password"
87
+ required
88
+ />
89
+ </div>
90
+ <Button className="w-full" type="submit">
91
+ Sign Up
92
+ </Button>
93
+ </CardContent>
94
+ <CardFooter className="flex flex-col space-y-4">
95
+ {/* <div className="relative w-full">
96
+ <div className="absolute inset-0 flex items-center">
97
+ <span className="w-full border-t" />
98
+ </div>
99
+ <div className="relative flex justify-center text-xs uppercase">
100
+ <span className="bg-background px-2 text-muted-foreground">
101
+ Or continue with
102
+ </span>
103
+ </div>
104
+ </div>
105
+ <div className="flex space-x-2">
106
+ <Button variant="outline" className="w-full">
107
+ Google
108
+ </Button>
109
+ <Button variant="outline" className="w-full">
110
+ GitHub
111
+ </Button>
112
+ </div> */}
113
+ <p className="text-center text-sm text-muted-foreground">
114
+ Already a user?{' '}
115
+ < Link
116
+ href = "/signin"
117
+ className = "underline underline-offset-4 hover:text-primary"
118
+ >
119
+ Sign in
120
+ </ Link >
121
+ < / p >
122
+ </CardFooter >
123
+ < / C a r d >
86
124
</form >
87
125
) ;
88
126
}
0 commit comments