Skip to content

Commit

Permalink
temp fix: dashboard navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
harshit-jain52 committed Nov 17, 2024
1 parent 8b2d9c4 commit 82bf323
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 28 deletions.
60 changes: 32 additions & 28 deletions src/pages/MentorDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ function MentorDashboard() {
navigate(ROUTER_PATHS.HOME);
}

if (authContext.userData.type === "student") {
navigate(ROUTER_PATHS.STUDENT_DASHBOARD);
}

if (authContext.userData.type !== "mentor") {
navigate(ROUTER_PATHS.HOME);
}
Expand Down Expand Up @@ -100,40 +104,40 @@ function MentorDashboard() {

{/* Right Sidebar - Stats & Resources */}
<div className="rightSidebar">
<div className="statsSectionCard">
<div className="statsSection">
<h3 className="statsHeader">Overall Stats</h3>
<div>
<div className="statsItem">
<div className="statsIconText">
<BiGitCommit />
<span>Total Commits:</span>
<div className="statsSectionCard">
<div className="statsSection">
<h3 className="statsHeader">Overall Stats</h3>
<div>
<div className="statsItem">
<div className="statsIconText">
<BiGitCommit />
<span>Total Commits:</span>
</div>
<p className="statsValue">{totalCommits}</p>
</div>
<p className="statsValue">{totalCommits}</p>
</div>
<div className="statsItem">
<div className="statsIconText">
<BiGitPullRequest />
<span>Total Pull Requests:</span>
<div className="statsItem">
<div className="statsIconText">
<BiGitPullRequest />
<span>Total Pull Requests:</span>
</div>
<p className="statsValue">{totalPRs}</p>
</div>
<p className="statsValue">{totalPRs}</p>
</div>
<div className="statsItem">
<div className="statsIconText">
<HiOutlineViewGridAdd size={20} />
<span>Total Projects:</span>
<div className="statsItem">
<div className="statsIconText">
<HiOutlineViewGridAdd size={20} />
<span>Total Projects:</span>
</div>
<p className="statsValue">{totalProjects}</p>
</div>
<p className="statsValue">{totalProjects}</p>
</div>
<div className="statsItem">
<div className="statsIconText">
<IoPersonSharp />
<span>Approved Projects:</span>
<div className="statsItem">
<div className="statsIconText">
<IoPersonSharp />
<span>Approved Projects:</span>
</div>
<p className="statsValue">{approvedProjects}</p>
</div>
<p className="statsValue">{approvedProjects}</p>
</div>
</div>
</div>
</div>

{/* Merged Pull Requests */}
Expand Down
4 changes: 4 additions & 0 deletions src/pages/StudentDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ function StudentDashboard() {
navigate(ROUTER_PATHS.HOME);
}

if (authContext.userData.type === "mentor") {
navigate(ROUTER_PATHS.MENTOR_DASHBOARD);
}

if (authContext.userData.type !== "student") {
navigate(ROUTER_PATHS.HOME);
}
Expand Down

0 comments on commit 82bf323

Please sign in to comment.