From e4cfdee3053447d024dc960b4442cd119abc3bce Mon Sep 17 00:00:00 2001 From: vibhaw raj Date: Thu, 19 Sep 2024 00:00:13 +0530 Subject: [PATCH] [add]:envExample --- .env.example | 7 +++++++ src/app/(dashboard)/leaderboard/page.tsx | 23 ++++++----------------- src/app/page.tsx | 22 +++++++++++----------- 3 files changed, 24 insertions(+), 28 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..798db6e --- /dev/null +++ b/.env.example @@ -0,0 +1,7 @@ +NEXT_PUBLIC_FIREBASE_API_KEY= +NEXT_PUBLIC_FIREBASE_API_AUTH_DOMAIN= +NEXT_PUBLIC_FIREBASE_API_PROJECT_ID= +NEXT_PUBLIC_FIREBASE_API_STORAGE_BUCKET= +NEXT_PUBLIC_FIREBASE_API_MESSAGING_SENDER_ID= +NEXT_PUBLIC_FIREBASE_API_APP_ID= +NEXT_PUBLIC_FIREBASE_API_MEASUREMENT_ID= diff --git a/src/app/(dashboard)/leaderboard/page.tsx b/src/app/(dashboard)/leaderboard/page.tsx index 7637529..fbf7365 100644 --- a/src/app/(dashboard)/leaderboard/page.tsx +++ b/src/app/(dashboard)/leaderboard/page.tsx @@ -1,27 +1,16 @@ "use client"; -import Leaderboard from '@/components/LeaderBoard'; -import React, { useEffect, useState } from 'react'; +import React from 'react'; +import dynamic from 'next/dynamic'; -const LeaderboardPage = () => { - const [windowWidth, setWindowWidth] = useState(0); - - - - useEffect(() => { +const Leaderboard = dynamic(() => import('@/components/LeaderBoard'), { ssr: false }); - if (typeof window !== 'undefined') { - - setWindowWidth(window.innerWidth); - - } - - }, []); +const LeaderboardPage = () => { return ( -
+
); }; -export default LeaderboardPage; +export default LeaderboardPage; \ No newline at end of file diff --git a/src/app/page.tsx b/src/app/page.tsx index 4e8770a..dc59aed 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -21,17 +21,17 @@ export default function HomePage() { } }, []); - useEffect(() => { - const unsubscribe = onAuthStateChanged(auth, (user) => { - if (user) { - router.push('/dashboard'); - } else { - router.push('/auth'); - } - }); - - return () => unsubscribe(); - }, [router, auth]); + // useEffect(() => { + // const unsubscribe = onAuthStateChanged(auth, (user) => { + // if (user) { + // router.push('/dashboard'); + // } else { + // router.push('/auth'); + // } + // }); + + // return () => unsubscribe(); + // }, [router, auth]); return
Loading...
; // Simple loading indicator }