Skip to content

Commit

Permalink
Hompage routing fix enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielEmmanuel1 committed Nov 19, 2024
1 parent 5f0cda0 commit 1a5f7ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
20 changes: 12 additions & 8 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import {
BrowserRouter as Router,
Route,
Routes,
// Navigate,
Navigate,
} from "react-router-dom";
import "./App.css";
// import { useContext } from 'react';
import { AuthProvider} from "./context/AuthContext";
import { AuthProvider } from "./context/AuthContext";
import PrivateRoute from "./context/PrivateRoute";
import PageLayout from './components/pages/PageLayout';
import LoginSection from "./components/pages/auth/LoginSection";
Expand All @@ -30,18 +30,22 @@ function App() {
{/* Login Routes */}
<Route path="/" element={<LoginSection />} />
<Route path="/login" element={<LoginSection />} />

{/* Protected Dashboard Routes */}
<Route path="/dashboard" element={<PrivateRoute><PageLayout/></PrivateRoute>}>
<Route index element={<HomePage/>}/>
<Route path="home" element={<HomePage/>}/>
<Route path="insights" element={<InsightsPage />}/>
<Route path="alerts" element={<AlertsPage />}/>
<Route path="/dashboard" element={<PrivateRoute><PageLayout /></PrivateRoute>}>
{/* Redirect /dashboard to /dashboard/home */}
<Route index element={<Navigate to="home" replace />} />
<Route path="home" element={<HomePage />} />
<Route path="insights" element={<InsightsPage />} />
<Route path="alerts" element={<AlertsPage />} />
<Route path="channels" element={<NewChannel />} />
</Route>

{/* 404 Page */}
<Route path="*" element={<NotFoundPage />} />
</Routes>
</Router>

</AuthProvider>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/pages/dashboard/admins/ManageAdmins.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,13 @@ const ManageAdmins: React.FC = () => {
<td className="border border-gray-200 px-6 py-3">
<button
onClick={() => handleResend(channel.email)}
className="mr-4 text-blue-500 hover:text-blue-700"
className="mr-4 text-black bg-green-400 px-4 py-1 hover:text-white"
>
Resend
</button>
<button
onClick={() => openDeleteModal(channel.channelName)}
className="text-red-500 hover:text-red-700"
className="text-black bg-red-600 px-4 py-1 hover:text-white"
>
Delete
</button>
Expand Down

0 comments on commit 1a5f7ee

Please sign in to comment.