diff --git a/app/locales/en/index.json b/app/locales/en/index.json
new file mode 100644
index 0000000..bd7c845
--- /dev/null
+++ b/app/locales/en/index.json
@@ -0,0 +1,7 @@
+{
+ "discoverPassion": "Discover Your Passion",
+ "findInterestingTopics": "Find out what topics you find interesting, learn a new skill & connect with people that are passionate about similar topics.",
+ "login": "Login",
+ "loginWithGoogle": "Login with Google",
+ "continueAsGuest": "Continue as a Guest"
+ }
\ No newline at end of file
diff --git a/app/locales/tr/index.json b/app/locales/tr/index.json
new file mode 100644
index 0000000..d52fae3
--- /dev/null
+++ b/app/locales/tr/index.json
@@ -0,0 +1,7 @@
+{
+ "discoverPassion": "Tutkunuzu Keşfedin",
+ "findInterestingTopics": "İlginç konuları bulun, yeni bir beceri öğrenin ve benzer konulara ilgi duyan insanlarla bağlantı kurun.",
+ "login": "Giriş Yap",
+ "loginWithGoogle": "Google ile Giriş Yap",
+ "continueAsGuest": "Misafir Olarak Devam Et"
+ }
\ No newline at end of file
diff --git a/components/GetStarted.jsx b/components/GetStarted.jsx
index 08ef0b3..237c87f 100644
--- a/components/GetStarted.jsx
+++ b/components/GetStarted.jsx
@@ -1,170 +1,110 @@
-'use client'
-import React,{useState, useEffect} from 'react'
-import Image from 'next/image'
+// Import statements using ESM syntax
+import React, { useState, useEffect } from 'react';
+import Image from 'next/image';
import Login from './Login';
import Link from 'next/link';
-import { doc,auth, firestore, setDoc } from '@/utils/firebase';
+import { auth } from '@/utils/firebase';
import { useAuthState } from 'react-firebase-hooks/auth';
-import { getUserCountry } from '@/app/pages/api/ip/route';
-import signIn from '@/app/pages/api/auth/signin'
+import signIn from '@/app/pages/api/auth/signin';
import { setIsAnonymous } from '@/redux/actions';
import { useDispatch } from 'react-redux';
+import useTranslation from 'next-translate';
+
+// Component definition
const GetStarted = ({ routers }) => {
- console.log(auth.currentUser)
- const [user, setUser] = useAuthState(auth);
- useEffect(() => { },[user])
- const dispatch = useDispatch()
+ const { t } = useTranslation();
+ const [user] = useAuthState(auth);
+ useEffect(() => {}, [user]);
+ const dispatch = useDispatch();
const [showLogin, setShowLogin] = useState(false);
- // const googleAuth = new GoogleAuthProvider();
-
+
const handleLoginClick = () => {
setShowLogin(true);
};
+
const handleContinueAsGuestClick = async () => {
-
const { result, error } = await signIn('anonymous');
- if (error) {
- return console.log(error)
- }
- dispatch(setIsAnonymous(true))
+ if (error) {
+ return console.log(error);
+ }
+ dispatch(setIsAnonymous(true));
- // else successful
- console.log(result)
- return routers.push('/pages/home')
+ console.log(result);
+ return routers.push('/pages/home');
};
const handleGoogleLoginClick = async () => {
- // isAnonymous = false;
const { result, error } = await signIn('google');
- if (error) {
- return console.log(error)
- }
- dispatch(setIsAnonymous(false))
- // else successful
- console.log(result)
- return routers.push('/pages/home')
-
+ if (error) {
+ return console.log(error);
+ }
+ dispatch(setIsAnonymous(false));
+
+ console.log(result);
+ return routers.push('/pages/home');
};
- // const result = await signInWithPopup(auth, googleAuth)
- // saveGoogleUserInfoToFirestore();
- // const { uid } = auth.currentUser;
- // localStorage.setItem('uid', uid);
- // routers.push('/pages/home')
-
-
- // };
- // const saveGoogleUserInfoToFirestore = async () => {
- // const { uid, displayName, email, photoURL } = auth.currentUser;
- // const res = await getUserCountry();
- // try {
- // await setDoc(doc(firestore,'users',uid),{
-
- // name: displayName,
- // email: email,
- // profilePicture: photoURL,
- // country: res,
-
- // }, { merge: true });
- // // console.log(uid,displayName,email,photoURL,country)
- // } catch (error) {
- // console.error('Firestore Update Error:', error);
- // }
- // };
- if (showLogin) {
- return
Course Worm
-{t('discoverPassion')}
+{t('findInterestingTopics')}
+Discover passion
- find out what topics you find interesting,
learn a new skill & connect with people that
are passionate about similer topics.