|
1 | 1 | import React from "react";
|
2 | 2 | import { Routes, Route, Link, useLocation } from "react-router-dom";
|
3 | 3 | import {
|
4 |
| - Code2, |
5 |
| - Zap, |
6 |
| - Trophy, |
7 |
| - Users, |
8 |
| - ArrowRight, |
9 |
| - Play, |
10 |
| - Star, |
11 |
| - GitBranch, |
12 |
| - Target, |
13 |
| - BarChart3, |
14 |
| - Calendar, |
15 |
| - Settings, |
16 | 4 | } from "lucide-react";
|
17 | 5 | import { motion } from "framer-motion";
|
18 | 6 | import HomePage from "./Pages/HomePage";
|
19 | 7 | import ProblemsPage from "./Pages/ProblemsPage";
|
20 |
| -import ProblemDetailPage from "./Pages/ProblemDetailPage"; |
21 |
| -import ContestsPage from "./Pages/ContestsPage"; |
22 |
| -import ContestDetailsPage from "./Pages/ContestDetailsPage"; |
23 |
| -import ContestProblemPage from "./Pages/ContestProblemPage"; |
24 |
| -import ContestResultsPage from "./Pages/ContestResultsPage"; |
25 |
| -import LeaderboardPage from "./Pages/LeaderboardPage"; |
26 |
| - |
27 |
| -import AdminDashboard from "./Pages/AdminDashboard"; |
28 | 8 |
|
29 | 9 | const Coding: React.FC = () => {
|
30 | 10 | const location = useLocation();
|
31 |
| - |
32 |
| - const navItems = [ |
33 |
| - { id: "home", label: "Home", path: "", icon: Code2 }, |
34 |
| - { id: "problems", label: "Problems", path: "problems", icon: Target }, |
35 |
| - { id: "contests", label: "Contests", path: "contests", icon: Trophy }, |
36 |
| - { |
37 |
| - id: "leaderboard", |
38 |
| - label: "Leaderboard", |
39 |
| - path: "leaderboard", |
40 |
| - icon: BarChart3, |
41 |
| - }, |
42 |
| - ]; |
43 |
| - |
44 | 11 | const isActive = (itemPath: string) => {
|
45 | 12 | const currentPath = location.pathname;
|
46 | 13 | if (itemPath === "") {
|
47 | 14 | return currentPath === "/coding" || currentPath === "/coding/";
|
48 | 15 | }
|
49 | 16 | return currentPath.startsWith(`/coding/${itemPath}`);
|
50 | 17 | };
|
51 |
| - |
52 | 18 | return (
|
53 |
| - <div className="min-h-screen bg-gray-900"> |
54 |
| - {/* Header */} |
55 |
| - <header className="border-b border-gray-800 backdrop-blur-sm bg-gray-900/95"> |
56 |
| - <div className="px-4 py-6 mx-auto max-w-7xl"> |
57 |
| - <div className="flex justify-between items-center"> |
58 |
| - {/* Navigation Tabs */} |
59 |
| - <nav className="flex p-1 space-x-1 bg-gray-800 rounded-lg"> |
60 |
| - {navItems.map((item) => { |
61 |
| - const Icon = item.icon; |
62 |
| - return ( |
63 |
| - <Link |
64 |
| - key={item.id} |
65 |
| - to={`/coding/${item.path}`} |
66 |
| - className={`flex items-center space-x-2 px-4 py-2 rounded-md text-sm font-medium transition-all duration-200 ${ |
67 |
| - isActive(item.path) |
68 |
| - ? "bg-electric-500 text-white shadow-lg shadow-electric-500/25" |
69 |
| - : "text-gray-400 hover:text-white hover:bg-gray-700" |
70 |
| - }`} |
71 |
| - > |
72 |
| - <Icon size={16} /> |
73 |
| - <span>{item.label}</span> |
74 |
| - </Link> |
75 |
| - ); |
76 |
| - })} |
77 |
| - </nav> |
78 |
| - </div> |
79 |
| - </div> |
80 |
| - </header> |
81 |
| - |
| 19 | + <div className="relative min-h-screen py-24 overflow-hidden bg-gradient-to-b from-gray-900 to-black"> |
82 | 20 | {/* Main Content */}
|
83 | 21 | <main className="px-4 py-8 mx-auto max-w-7xl">
|
84 | 22 | <Routes>
|
85 | 23 | <Route path="/" element={<HomePage />} />
|
86 | 24 | <Route path="/problems" element={<ProblemsPage />} />
|
87 |
| - <Route path="/problems/:id" element={<ProblemDetailPage />} /> |
88 |
| - <Route path="/contests" element={<ContestsPage />} /> |
89 |
| - <Route path="contests/:id" element={<ContestDetailsPage />} /> |
90 |
| - <Route |
91 |
| - path="contests/:contestId/problems/:problemId" |
92 |
| - element={<ContestProblemPage />} |
93 |
| - /> |
94 |
| - <Route |
95 |
| - path="/contests/:contestId/results" |
96 |
| - element={<ContestResultsPage />} |
97 |
| - /> |
98 |
| - <Route path="/leaderboard" element={<LeaderboardPage />} /> |
99 |
| - <Route path="/admin" element={<AdminDashboard />} /> |
100 | 25 | </Routes>
|
101 | 26 | </main>
|
102 | 27 | </div>
|
|
0 commit comments