File tree Expand file tree Collapse file tree 5 files changed +10
-8
lines changed
frontend/src/app/(auth)/leetcode-dashboard Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1
1
"use client" ;
2
2
3
- import AddQuestionDialog from "@/app/(auth)/leetcode-dashboard/AddQuestionDialog" ;
4
- import { LeetcodeDashboardTable } from "@/app/(auth)/leetcode-dashboard/LeetcodeDashboardTable" ;
3
+ import AddQuestionDialog from "@/app/(auth)/leetcode-dashboard/components/ AddQuestionDialog" ;
4
+ import { LeetcodeDashboardTable } from "@/app/(auth)/leetcode-dashboard/components/ LeetcodeDashboardTable" ;
5
5
import { Button } from "@/components/ui/button" ;
6
6
import Container from "@/components/ui/Container" ;
7
7
import { PlusIcon } from "lucide-react" ;
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ import {
28
28
} from "@/api/leetcode-dashboard" ;
29
29
import { QuestionMinified } from "@/types/find-match" ;
30
30
import MoonLoader from "react-spinners/MoonLoader" ;
31
- import EditQuestionDialog from "@/app/(auth)/leetcode-dashboard/EditQuestionDialog" ;
31
+ import EditQuestionDialog from "@/app/(auth)/leetcode-dashboard/components/ EditQuestionDialog" ;
32
32
import { motion } from "framer-motion" ;
33
33
import Modal from "react-modal" ;
34
34
import Swal from "sweetalert2" ;
Original file line number Diff line number Diff line change 1
1
"use client" ;
2
2
3
- import { useAuth } from "@/components/auth/AuthContext" ;
3
+ import { AuthStatus , useAuth } from "@/components/auth/AuthContext" ;
4
4
import { useState , useEffect } from "react" ;
5
5
import LandingPage from "@/app/(home)/components/landing-page/LandingPage" ;
6
6
import LeetcodeDashboard from "./LeetcodeDashboard" ;
7
+ import { getToken } from "@/api/user" ;
7
8
8
- const Home = ( ) => {
9
- const { token } = useAuth ( ) ;
9
+ const LeetcodeDashboardPage = ( ) => {
10
+ const token = getToken ( ) ;
11
+ const { authStatus } = useAuth ( ) ;
10
12
const [ loading , setLoading ] = useState ( true ) ;
11
13
12
14
// Simulate token fetching or resolving logic
@@ -20,7 +22,7 @@ const Home = () => {
20
22
return null ;
21
23
}
22
24
23
- return token ? < LeetcodeDashboard /> : < LandingPage /> ;
25
+ return authStatus === AuthStatus . ADMIN ? < LeetcodeDashboard /> : < LandingPage /> ;
24
26
} ;
25
27
26
- export default Home ;
28
+ export default LeetcodeDashboardPage ;
You can’t perform that action at this time.
0 commit comments