Skip to content

Commit

Permalink
Public the leaderboard
Browse files Browse the repository at this point in the history
  • Loading branch information
MeetDOD committed Jun 8, 2024
1 parent 8cbfdfa commit f8e8480
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
2 changes: 0 additions & 2 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ function App() {
<Route
path="/app/leaderboard"
element={
<AuthenticatedRoute>
<LeaderBoard />
</AuthenticatedRoute>
}
/>
<Route
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ const Navbar = () => {
Posts
</Link>
</li>
<li className="mt-2">
<Link to="/app/leaderboard" className={getNavLinkClass("/app/leaderboard")} onClick={closeMenu}>
Leaderboard
</Link>
</li>
{!isLoggedIn ? (
<div className="flex flex-col md:flex-row md:space-x-4">
<li className="mb-2 md:mb-0">
Expand Down Expand Up @@ -118,11 +123,6 @@ const Navbar = () => {
Favorite
</Link>
</li>
<li className="mt-2">
<Link to="/app/leaderboard" className={getNavLinkClass("/app/leaderboard")} onClick={closeMenu}>
Leaderboard
</Link>
</li>
<li className="mt-2">
<button
className="block py-2 px-3 rounded md:border-0 md:p-0 text-white md:hover:text-blue-500 hover:bg-gray-700 hover:text-white md:hover:bg-transparent w-full text-left"
Expand Down
5 changes: 0 additions & 5 deletions frontend/src/pages/LeaderBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { ILeaderboardUser } from '../types';
import { GiTrophyCup } from "react-icons/gi";
import { useRecoilValue } from 'recoil';
import { userState } from '../store/atoms/auth';
import { Navigate } from 'react-router-dom';

const LeaderBoard = () => {
const [loading, setLoading] = useState(true);
Expand All @@ -27,10 +26,6 @@ const LeaderBoard = () => {
fetchLeaderboard();
}, []);

if (!currentUser) {
return <Navigate to='/app' />
}

return (
<div className="p-3 mb-10">
<h2 className="text-3xl font-bold text-center mb-8 text-gray-50">Leaderboard 🥳</h2>
Expand Down

0 comments on commit f8e8480

Please sign in to comment.