Skip to content

Commit

Permalink
#103 Navigation fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ndahimana154 committed Sep 11, 2024
1 parent 2f0727f commit 1379c95
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 30 deletions.
12 changes: 6 additions & 6 deletions src/components/sidebar/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ const sidebar = () => {
key={index}
className=" align-items-center dark:text-white text-[#173B3F] text-base"
>
<a
href={items.path}
<Link
to={items.path}
className="p-1 flex align-items-center leading-3 cursor-pointer font-semibold hover:font-bold"
>
<label className="mr-3 p-1">{items.icon}</label>
<label className="p-1">{items.title} </label>
</a>
</Link>
</li>
);
})}
Expand All @@ -95,12 +95,12 @@ const sidebar = () => {
key={index}
className=" justify-content-center mb-1 align-items-center dark:text-white text-[#173B3F] text-lg ml-2"
>
<a
href={items.path}
<Link
to={items.path}
className="p-1 flex align-items-center leading-5 cursor-pointer"
>
<label className="mr-3 p-1">{items.icon}</label>
</a>
</Link>
</li>
);
})}
Expand Down
2 changes: 1 addition & 1 deletion src/components/sidebar/sidebarItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Icon } from '@iconify/react';

export const sidebarItems1 = [
{
path: '/dashboard',
path: '/',
icon: <Icon icon="fontisto:pie-chart-1"></Icon>,
title: 'Dashboard',
},
Expand Down
21 changes: 21 additions & 0 deletions src/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react'
import NavBar from '../components/sidebar/navHeader'

const Dashboard = () => {
return (
<>
<NavBar />
<div className='h-screen mt-[-6%] bg-[#374151]'>
<div className='block mt-20'>
<h1>
<center>
Dashboard Page
</center>
</h1>
</div>
</div>
</>
)
}

export default Dashboard
32 changes: 9 additions & 23 deletions src/routes/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import SubmitApplication from '../pages/SubmitApplication';
import GradingSystemPage from "../pages/GradingSystemPage";
import ListApplications from './../pages/Applications/AdminViewApplications';
import ApplicationDetails from '../pages/Applications/ViewSingleApplication';
import Dashboard from '../pages/Dashboard';

function Navigation() {
const roleName = localStorage.getItem('roleName');
Expand All @@ -52,7 +53,7 @@ function Navigation() {
</PrivateRoute>
}
/>
<Route
<Route
path="/application-details/:appId"
element={
<PrivateRoute>
Expand Down Expand Up @@ -142,17 +143,10 @@ function Navigation() {
/>
<Route
path="/"
element={roleName === 'applicant' ?
(
<PrivateRoute>
<Applications />
</PrivateRoute>
) : (
<PrivateRoute>
<Trainee />
</PrivateRoute>
)

element={
<PrivateRoute>
<Dashboard />
</PrivateRoute>
}
/>
<Route
Expand Down Expand Up @@ -212,14 +206,6 @@ function Navigation() {
</PrivateRoute>
}
/>
<Route
path="/program/:id"
element={
<PrivateRoute>
<SingleProgramDetails />
</PrivateRoute>
}
/>
<Route
path="/programs"
element={
Expand Down Expand Up @@ -321,12 +307,12 @@ function Navigation() {
/>
<Route
element={
<PrivateRoute>
<PrivateRoute>
<ListApplications />
</PrivateRoute>
</PrivateRoute>
}
path='/view-applications'
/>
/>

</Routes>

Expand Down

0 comments on commit 1379c95

Please sign in to comment.