|
1 | | -import { Button } from "./button"; |
2 | | -import { FcGoogle } from "react-icons/fc"; |
| 1 | +"use client"; |
| 2 | +import { |
| 3 | + Dialog, |
| 4 | + DialogContent, |
| 5 | + DialogDescription, |
| 6 | + DialogHeader, |
| 7 | + DialogTitle, |
| 8 | + DialogTrigger, |
| 9 | +} from "@/components/ui/dialog"; |
| 10 | +import { signIn } from "next-auth/react"; |
3 | 11 | import { FaGithub } from "react-icons/fa6"; |
| 12 | +import { FcGoogle } from "react-icons/fc"; |
| 13 | +import { UserCredentials, LoginComp } from "./index"; |
| 14 | +import { Button } from "./button"; |
4 | 15 |
|
5 | 16 | export const SigninRightCom = () => { |
| 17 | + const handleGoogleSignIn = async () => { |
| 18 | + await signIn("google"); |
| 19 | + }; |
| 20 | + const handleGithubSignIn = async () => { |
| 21 | + await signIn("github"); |
| 22 | + }; |
| 23 | + |
| 24 | + const handleCredentialsSignIn = () => { |
| 25 | + signIn("credentials"); |
| 26 | + }; |
| 27 | + |
6 | 28 | return ( |
7 | 29 | <div> |
8 | | - <div className="flex justify-center items-center h-screen"> |
| 30 | + <div className="custom:flex custom:justify-center custom:items-center custom:h-screen"> |
9 | 31 | <div> |
10 | 32 | <div className="text-6xl font-bold my-8">Happening now</div> |
11 | 33 | <div className="text-3xl font-bold">Join Today.</div> |
12 | | - |
13 | | - <Button className="mt-10 px-20 "> |
14 | | - {" "} |
15 | | - <FcGoogle /> Sign UP with Google{" "} |
16 | | - </Button> |
17 | | - <br /> |
18 | | - <Button className="mt-10 px-20"> |
19 | | - {" "} |
20 | | - <FaGithub /> Sign UP with Google{" "} |
21 | | - </Button> |
| 34 | + <div className="flex flex-col max-w-64"> |
| 35 | + <Button |
| 36 | + className="mt-10 px-36 rounded-2xl" |
| 37 | + onClick={handleGoogleSignIn} |
| 38 | + > |
| 39 | + {" "} |
| 40 | + <FcGoogle /> Sign UP with Google{" "} |
| 41 | + </Button> |
| 42 | + <Button |
| 43 | + className="mt-2 px-36 rounded-2xl font-bold" |
| 44 | + onClick={handleGithubSignIn} |
| 45 | + > |
| 46 | + {" "} |
| 47 | + <FaGithub /> Sign UP with Github{" "} |
| 48 | + </Button> |
| 49 | + </div> |
| 50 | + <div className="flex items-center justify-center max-w-64 ml-4"> |
| 51 | + <hr className="w-72 h-0.5 my-4 bg-gray-200 border-0 rounded dark:bg-gray-700"></hr> |
| 52 | + <p className="px-2 text-slate-500">or</p> |
| 53 | + <hr className="w-72 h-0.5 my-4 bg-gray-200 border-0 rounded dark:bg-gray-700"></hr> |
| 54 | + </div> |
| 55 | + {/* <Button |
| 56 | + className="bg-twitterBlue hover:bg-blue-500 px-24 mt-0 rounded-2xl text-white" |
| 57 | + onClick={handleCredentialsSignIn} |
| 58 | + > |
| 59 | + Create Account |
| 60 | + </Button> */} |
| 61 | + <Dialog> |
| 62 | + <DialogTrigger className="bg-twitterBlue hover:bg-blue-500 py-1 px-24 mt-0 rounded-2xl text-white"> |
| 63 | + Create Account |
| 64 | + </DialogTrigger> |
| 65 | + <DialogContent className="bg-black min-w-96 max-w-96"> |
| 66 | + <DialogHeader> |
| 67 | + <DialogTitle className="w-4/5 flex items-center justify-center "> |
| 68 | + <UserCredentials /> |
| 69 | + </DialogTitle> |
| 70 | + </DialogHeader> |
| 71 | + </DialogContent> |
| 72 | + </Dialog> |
| 73 | + <p className="text-xs text-slate-600 mt-0.5 w-64"> |
| 74 | + By signing up, you agree to the{" "} |
| 75 | + <span className="text-twitterBlue">Terms of Service</span> and |
| 76 | + <span className="text-twitterBlue"> Privacy Policy</span>, including |
| 77 | + <span className="text-twitterBlue"> Cookie Use.</span> |
| 78 | + </p> |
| 79 | + <div className="mt-12 font-semibold">Already have an account?</div> |
| 80 | + {/* <Button |
| 81 | + variant={"outline"} |
| 82 | + className="mt-3 px-28 rounded-2xl text-twitterBlue" |
| 83 | + > |
| 84 | + Sign In |
| 85 | + </Button> */} |
| 86 | + <Dialog> |
| 87 | + <DialogTrigger className=" border border-slate-500 py-1 px-24 mt-1 rounded-2xl text-twitterBlue font-semibold hover:bg-slate-900 "> |
| 88 | + Sign In |
| 89 | + </DialogTrigger> |
| 90 | + <DialogContent className="bg-black min-w-96 max-w-96"> |
| 91 | + <DialogHeader> |
| 92 | + <DialogTitle className="w-4/5 flex items-center justify-center "> |
| 93 | + <LoginComp /> |
| 94 | + </DialogTitle> |
| 95 | + </DialogHeader> |
| 96 | + </DialogContent> |
| 97 | + </Dialog> |
22 | 98 | </div> |
23 | 99 | </div> |
24 | 100 | </div> |
|
0 commit comments