Code
Code
1 // "use client";
2 // import { motion } from "framer-motion";
3 // import Image from "next/image";
4 // import Link from "next/link";
5 // import { useEffect, useState } from "react";
6 // import { GoogleAuthProvider, signInWithPopup, signOut, onAuthStateChanged }
from "firebase/auth";
7 // import { useRouter } from "next/navigation";
8 // import { auth } from "./firebaseConfig";
9
10 // const Signup = () => {
11 // const router = useRouter();
12 // const [user, setUser] = useState<any>(null);
13
14 // useEffect(() => {
15 // const unsubscribe = onAuthStateChanged(auth, (currentUser) => {
16 // setUser(currentUser);
17 // });
18 // return () => unsubscribe();
19 // }, []);
20
21 // const handleGoogleSignIn = async () => {
22 // const provider = new GoogleAuthProvider();
23
24 // try {
25 // const result = await signInWithPopup(auth, provider);
26 // const loggedInUser = result.user;
27 // console.log("User Info:", loggedInUser);
28 // alert(`Welcome ${loggedInUser.displayName}`);
29 // } catch (error) {
30 // console.error("Error signing in with Google:", error);
31 // alert("Login failed, please try again.");
32 // }
33 // };
34
35 // const handleLogout = async () => {
36 // try {
37 // await signOut(auth);
38 // alert("You have successfully logged out.");
39 // setUser(null);
40 // router.push("/auth/signin");
41 // } catch (error) {
42 // console.error("Error logging out:", error);
43 // alert("Logout failed, please try again.");
44 // }
45 // };
46
47 // return (
48 // <>
49 // {/* <!-- ===== SignUp Form Start ===== --> */}
https://tarikjaber.github.io/Code-to-PDF/ 1/8
11/21/24, 1:23 PM Code
https://tarikjaber.github.io/Code-to-PDF/ 2/8
11/21/24, 1:23 PM Code
https://tarikjaber.github.io/Code-to-PDF/ 3/8
11/21/24, 1:23 PM Code
https://tarikjaber.github.io/Code-to-PDF/ 4/8
11/21/24, 1:23 PM Code
https://tarikjaber.github.io/Code-to-PDF/ 5/8
11/21/24, 1:23 PM Code
220 />
221 <Image
222 src="/images/shape/shape-dotted-dark.svg"
223 alt="Dotted"
224 className="hidden dark:block"
225 fill
226 />
227 </div>
228
229 <motion.div
230 variants={{
231 hidden: {
232 opacity: 0,
233 y: -20,
234 },
235
236 visible: {
237 opacity: 1,
238 y: 0,
239 },
240 }}
241 initial="hidden"
242 whileInView="visible"
243 transition={{ duration: 1, delay: 0.1 }}
244 viewport={{ once: true }}
245 className="animate_top rounded-lg bg-white px-7.5 pt-7.5 shadow-
solid-8 dark:border dark:border-strokedark dark:bg-black xl:px-15 xl:pt-15"
246 >
247 <h2 className="mb-15 text-center text-3xl font-semibold text-black
dark:text-white xl:text-sectiontitle2">
248 Create an Account
249 </h2>
250
251
252 <div className="flex items-center flex-col">
253 <div className="flex items-center gap-8 w-1/2 justify-
center">
254 <button
255 aria-label="signup with google"
256 className=" text-body-color dark:text-body-color-dark
dark:shadow-two mb-6 flex w-full items-center justify-center rounded-sm border
border-stroke bg-[#f8f8f8] px-6 py-3 text-base outline-none transition-all
duration-300 hover:border-primary hover:bg-primary/5 hover:text-primary
dark:border-transparent dark:bg-[#2C303B] dark:hover:border-primary
dark:hover:bg-primary/5 dark:hover:text-primary dark:hover:shadow-none"
257 >
258 <span className="mr-3">
259 <svg
260 width="20"
261 height="20"
262 viewBox="0 0 20 20"
https://tarikjaber.github.io/Code-to-PDF/ 6/8
11/21/24, 1:23 PM Code
263 fill="none"
264 xmlns="http://www.w3.org/2000/svg"
265 >
266 <g clipPath="url(#clip0_95:967)">
267 <path
268 d="M20.0001 10.2216C20.0122 9.53416 19.9397 8.84776
19.7844 8.17725H10.2042V11.8883H15.8277C15.7211 12.539 15.4814 13.1618 15.1229
13.7194C14.7644 14.2769 14.2946 14.7577 13.7416 15.1327L13.722 15.257L16.7512
17.5567L16.961 17.5772C18.8883 15.8328 19.9997 13.266 19.9997 10.2216"
269 fill="#4285F4"
270 />
271 <path
272 d="M10.2042 20.0001C12.9592 20.0001 15.2721 19.1111
16.9616 17.5778L13.7416 15.1332C12.88 15.7223 11.7235 16.1334 10.2042
16.1334C8.91385 16.126 7.65863 15.7206 6.61663 14.9747C5.57464 14.2287 4.79879
13.1802 4.39915 11.9778L4.27957 11.9878L1.12973 14.3766L1.08856 14.4888C1.93689
16.1457 3.23879 17.5387 4.84869 18.512C6.45859 19.4852 8.31301 20.0005 10.2046
20.0001"
273 fill="#34A853"
274 />
275 <path
276 d="M4.39911 11.9777C4.17592 11.3411 4.06075 10.673
4.05819 9.99996C4.0623 9.32799 4.17322 8.66075 4.38696 8.02225L4.38127
7.88968L1.19282 5.4624L1.08852 5.51101C0.372885 6.90343 0.00012207 8.4408
0.00012207 9.99987C0.00012207 11.5589 0.372885 13.0963 1.08852 14.4887L4.39911
11.9777Z"
277 fill="#FBBC05"
278 />
279 <path
280 d="M10.2042 3.86663C11.6663 3.84438 13.0804 4.37803
14.1498 5.35558L17.0296 2.59996C15.1826 0.901848 12.7366 -0.0298855 10.2042
-3.6784e-05C8.3126 -0.000477834 6.45819 0.514732 4.8483 1.48798C3.2384 2.46124
1.93649 3.85416 1.08813 5.51101L4.38775 8.02225C4.79132 6.82005 5.56974 5.77231
6.61327 5.02675C7.6568 4.28118 8.91279 3.87541 10.2042 3.86663Z"
281 fill="#EB4335"
282 />
283 </g>
284 <defs>
285 <clipPath id="clip0_95:967">
286 <rect width="20" height="20" fill="white" />
287 </clipPath>
288 </defs>
289 </svg>
290 </span>
291 Signup with Google
292 </button>
293
294
295 </div>
296 </div>
297
https://tarikjaber.github.io/Code-to-PDF/ 7/8
11/21/24, 1:23 PM Code
298
299
300
301
302 <div className="mt-12.5 border-t border-stroke py-5 text-center
dark:border-strokedark">
303 <p>
304 Already have an account?{" "}
305 <Link
306 className="text-black hover:text-primary dark:text-white
dark:hover:text-primary"
307 href="/auth/signin"
308 >
309 Sign In
310 </Link>
311 </p>
312 </div>
313
314 </motion.div>
315 </div>
316 </section>
317 {/* <!-- ===== SignUp Form End ===== --> */}
318 </>
319 );
320 };
321
322 export default Signup;
323
https://tarikjaber.github.io/Code-to-PDF/ 8/8