feat(frontend): implement dashboard page
- Create DashboardPage with active events, matches, and requests - Add dashboardAPI.getData() to services/api.js - Add /dashboard route as default landing after login - Update Navbar with Dashboard and Events links - Show video exchange and rating status for matches - Handle match accept/reject/cancel actions
This commit is contained in:
@@ -6,6 +6,7 @@ import RegisterPage from './pages/RegisterPage';
|
||||
import VerifyEmailPage from './pages/VerifyEmailPage';
|
||||
import ForgotPasswordPage from './pages/ForgotPasswordPage';
|
||||
import ResetPasswordPage from './pages/ResetPasswordPage';
|
||||
import DashboardPage from './pages/DashboardPage';
|
||||
import EventsPage from './pages/EventsPage';
|
||||
import EventChatPage from './pages/EventChatPage';
|
||||
import EventDetailsPage from './pages/EventDetailsPage';
|
||||
@@ -43,7 +44,7 @@ const ProtectedRoute = ({ children }) => {
|
||||
);
|
||||
};
|
||||
|
||||
// Public Route Component (redirect to events if already logged in)
|
||||
// Public Route Component (redirect to dashboard if already logged in)
|
||||
const PublicRoute = ({ children }) => {
|
||||
const { isAuthenticated, loading } = useAuth();
|
||||
|
||||
@@ -56,7 +57,7 @@ const PublicRoute = ({ children }) => {
|
||||
}
|
||||
|
||||
if (isAuthenticated) {
|
||||
return <Navigate to="/events" replace />;
|
||||
return <Navigate to="/dashboard" replace />;
|
||||
}
|
||||
|
||||
return children;
|
||||
@@ -92,6 +93,14 @@ function App() {
|
||||
<Route path="/reset-password" element={<ResetPasswordPage />} />
|
||||
|
||||
{/* Protected Routes */}
|
||||
<Route
|
||||
path="/dashboard"
|
||||
element={
|
||||
<ProtectedRoute>
|
||||
<DashboardPage />
|
||||
</ProtectedRoute>
|
||||
}
|
||||
/>
|
||||
<Route
|
||||
path="/events"
|
||||
element={
|
||||
|
||||
Reference in New Issue
Block a user