11import { NODE_ENV } from "@cap/env" ;
2- import { Button , Dialog , DialogContent , LogoBadge } from "@cap/ui" ;
3- import { motion } from "framer-motion" ;
2+ import { Button , Dialog , DialogContent , Input , LogoBadge } from "@cap/ui" ;
43import { signIn } from "next-auth/react" ;
54import { useState } from "react" ;
65import { toast } from "sonner" ;
6+ import Image from "next/image" ;
7+ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome" ;
8+ import { faEnvelope } from "@fortawesome/free-solid-svg-icons" ;
79
810interface AuthOverlayProps {
911 isOpen : boolean ;
1012 onClose : ( ) => void ;
1113}
1214
13- const MotionDialogContent = motion . create ( DialogContent ) ;
14-
1515export const AuthOverlay : React . FC < AuthOverlayProps > = ( {
1616 isOpen,
1717 onClose,
@@ -26,75 +26,46 @@ export const AuthOverlay: React.FC<AuthOverlayProps> = ({
2626
2727 return (
2828 < Dialog open = { isOpen } onOpenChange = { onClose } >
29- < MotionDialogContent
30- initial = { { opacity : 0 , scale : 0.95 } }
31- animate = { { opacity : 1 , scale : 1 } }
32- exit = { { opacity : 0 , scale : 0.95 } }
33- transition = { { duration : 0.2 } }
29+ < DialogContent
3430 className = "w-[90vw] sm:max-w-md p-6 rounded-xl"
3531 >
3632 < div className = "space-y-6" >
3733 < LogoBadge className = "w-auto h-12" />
3834
39- < div className = "space-y-3 text-left" >
40- < motion . h1
41- initial = { { opacity : 0 , y : 20 } }
42- animate = { { opacity : 1 , y : 0 } }
43- transition = { { delay : 0.1 } }
44- className = "text-3xl font-semibold"
35+ < div className = "text-left" >
36+ < h1
37+ className = "text-xl font-semibold"
4538 >
4639 Sign in to comment
47- </ motion . h1 >
48- < motion . p
49- initial = { { opacity : 0 , y : 20 } }
50- animate = { { opacity : 1 , y : 0 } }
51- transition = { { delay : 0.2 } }
52- className = "text-2xl text-gray-1"
40+ </ h1 >
41+ < p
42+ className = "text-lg text-gray-9"
5343 >
5444 Join the conversation.
55- </ motion . p >
45+ </ p >
5646 </ div >
5747
58- < div className = "flex flex-col space-y-3 fade-in-down animate-delay-2 " >
59- { NODE_ENV ! == "development" && (
48+ < div className = "flex flex-col space-y-3" >
49+ { NODE_ENV = == "development" && (
6050 < >
6151 < Button
62- variant = "darkgradient"
63- size = "lg"
64- className = "flex justify-center items-center space-x-2 h-12 text-lg"
52+ variant = "primary"
6553 onClick = { handleGoogleSignIn }
6654 disabled = { loading }
6755 >
68- < svg
69- className = "w-4 h-4"
70- xmlns = "http://www.w3.org/2000/svg"
71- fill = "none"
72- viewBox = "0 0 12 12"
73- >
74- < g fill = "#E1E1E6" clipPath = "url(#clip0)" >
75- < path d = "M11.762 6.138c0-.408-.033-.818-.104-1.22h-5.66V7.23H9.24a2.78 2.78 0 0 1-1.2 1.823v1.5h1.934c1.135-1.046 1.788-2.589 1.788-4.414" > </ path >
76- < path d = "M5.999 12c1.618 0 2.983-.531 3.977-1.448l-1.933-1.5c-.538.367-1.233.574-2.042.574-1.565 0-2.892-1.056-3.369-2.476H.637v1.545A6 6 0 0 0 6 12" > </ path >
77- < path d = "M2.63 7.15a3.6 3.6 0 0 1 0-2.297V3.307H.637a6 6 0 0 0 0 5.388z" > </ path >
78- < path d = "M5.999 2.374a3.26 3.26 0 0 1 2.302.9l1.713-1.713A5.77 5.77 0 0 0 5.999 0 6 6 0 0 0 .637 3.307L2.63 4.852C3.104 3.43 4.434 2.374 6 2.374" > </ path >
79- </ g >
80- < defs >
81- < clipPath id = "clip0" >
82- < path fill = "#fff" d = "M0 0h11.762v12H0z" > </ path >
83- </ clipPath >
84- </ defs >
85- </ svg >
86- < span className = "text-gray-50" > Continue with Google</ span >
56+ < Image
57+ src = "/logos/google.svg"
58+ alt = "Google"
59+ className = "mr-1 size-4"
60+ width = { 16 }
61+ height = { 16 }
62+ />
63+ Continue with Google
8764 </ Button >
88-
89- < div className = "relative" >
90- < div className = "flex absolute inset-0 items-center" >
91- < div className = "w-full border-t border-blue-100" />
92- </ div >
93- < div className = "flex relative justify-center" >
94- < span className = "px-2 text-xs rounded-xl bg-gray-1 text-gray-1" >
95- Or
96- </ span >
97- </ div >
65+ < div className = "flex gap-4 items-center my-4" >
66+ < span className = "flex-1 h-px bg-gray-5" />
67+ < p className = "text-sm text-center text-gray-8" > OR</ p >
68+ < span className = "flex-1 h-px bg-gray-5" />
9869 </ div >
9970 </ >
10071 ) }
@@ -128,7 +99,7 @@ export const AuthOverlay: React.FC<AuthOverlayProps> = ({
12899 className = "flex flex-col space-y-3"
129100 >
130101 < div >
131- < input
102+ < Input
132103 id = "email"
133104 name = "email"
134105 autoFocus
@@ -141,7 +112,6 @@ export const AuthOverlay: React.FC<AuthOverlayProps> = ({
141112 onChange = { ( e ) => {
142113 setEmail ( e . target . value ) ;
143114 } }
144- className = "block px-3 w-full h-12 text-lg placeholder-gray-400 rounded-full border border-gray-300 shadow-sm appearance-none focus:border-black focus:outline-none focus:ring-black"
145115 />
146116 { NODE_ENV === "development" && (
147117 < div className = "flex justify-center items-center px-6 py-3 mt-3 bg-red-600 rounded-xl" >
@@ -156,9 +126,8 @@ export const AuthOverlay: React.FC<AuthOverlayProps> = ({
156126 </ div >
157127 < Button
158128 variant = "primary"
159- size = "lg"
160- className = "h-12 text-lg"
161129 type = "submit"
130+ icon = { < FontAwesomeIcon className = "mr-1 size-4" icon = { faEnvelope } /> }
162131 disabled = { loading || emailSent }
163132 >
164133 { emailSent
@@ -167,21 +136,21 @@ export const AuthOverlay: React.FC<AuthOverlayProps> = ({
167136 : "Email sent to your inbox"
168137 : "Continue with Email" }
169138 </ Button >
170- < p className = "pt-2 text-xs text-gray-1 " >
139+ < p className = "pt-2 text-xs text-center text- gray-12 " >
171140 By typing your email and clicking continue, you acknowledge that
172141 you have both read and agree to Cap's{ " " }
173142 < a
174143 href = "/terms"
175144 target = "_blank"
176- className = "text-xs font-semibold text-gray-600 "
145+ className = "text-xs font-semibold text-gray-12 hover:text-blue-300 "
177146 >
178147 Terms of Service
179148 </ a > { " " }
180149 and{ " " }
181150 < a
182151 href = "/privacy"
183152 target = "_blank"
184- className = "text-xs font-semibold text-gray-600 "
153+ className = "text-xs font-semibold text-gray-12 hover:text-blue-300 "
185154 >
186155 Privacy Policy
187156 </ a >
@@ -205,7 +174,7 @@ export const AuthOverlay: React.FC<AuthOverlayProps> = ({
205174 </ div >
206175 ) }
207176 </ div >
208- </ MotionDialogContent >
177+ </ DialogContent >
209178 </ Dialog >
210179 ) ;
211180} ;
0 commit comments