Skip to content

Commit

Permalink
[add]:envExample
Browse files Browse the repository at this point in the history
  • Loading branch information
vibhaw1904 committed Sep 18, 2024
1 parent 761a7fb commit e4cfdee
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -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=
23 changes: 6 additions & 17 deletions src/app/(dashboard)/leaderboard/page.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<div>
<div className="min-h-screen bg-gray-900">
<Leaderboard />
</div>
);
};

export default LeaderboardPage;
export default LeaderboardPage;
22 changes: 11 additions & 11 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <div>Loading...</div>; // Simple loading indicator
}

0 comments on commit e4cfdee

Please sign in to comment.