Skip to content

As an admin, I should be able to view invitations breakdown.(Team fig… #444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"react-dropdown-select": "^4.10.0",
"react-hook-form": "^7.45.2",
"react-i18next": "^11.18.6",
"react-icons": "^4.10.1",
"react-icons": "^4.12.0",
"react-loader-spinner": "^5.4.5",
"react-pdf": "^7.3.3",
"react-pdf-js": "^5.1.0",
Expand Down
42 changes: 42 additions & 0 deletions src/components/InvitationCard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react';
import { AiOutlineRise } from "react-icons/ai";

// Define the type for the props
interface InvitationCardType {
icon: React.ReactNode;
status: string;
time: string;
staticNumber: string;
percentage: string;
}

// Define the InvitationCard component
const InvitationCard: React.FC<InvitationCardType> = ({ icon, status, time, staticNumber, percentage }) => {

Check failure on line 14 in src/components/InvitationCard.tsx

View workflow job for this annotation

GitHub Actions / build

Function component is not a function declaration
return (
<>
<div className='bg-blue-100 w-48 grid grid-row-4 rounded-2xl'>
<div>
<div>
<h3 className='ml-6 p-2 text-2xl font-serif font-bold text-[20px]'>{status}</h3>
<div className='flex gap-2 w-8 h-10'>
{icon}
</div>
<div>
<p className='ml-10 mb-8'>{time}</p>
</div>
</div>
</div>
<div className='flex justify-center items-center pb-5'>
<div className='text-2xl font-serif font-bold text-[40px]'>{staticNumber}</div>
<div className='text-base text-[#7258ce] ml-3 mb-5'>
<AiOutlineRise className="text-2xl" />
<span>{percentage}</span>
</div>
</div>
</div>
</>
);
}

export default InvitationCard;

12 changes: 9 additions & 3 deletions src/components/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
MoonIcon,
MailIcon,
} from '@heroicons/react/solid';
import { FaEnvelopeOpenText } from "react-icons/fa6";
import {
AcademicCapIcon,
BookOpenIcon,
Expand All @@ -36,9 +37,8 @@ function Sidebar({ style, toggle }: { style: string; toggle: () => void }) {
const { logout } = useContext(UserContext);
return (
<div
className={`${
showNav ? 'block' : 'hidden'
} lg:block page-sideNav fixed lg:static top-16 bottom-0`}
className={`${showNav ? 'block' : 'hidden'
} lg:block page-sideNav fixed lg:static top-16 bottom-0`}
>
<div
className={`${style} overflow-auto flex-col h-[100%] pt-2 bg-indigo-100 dark:bg-dark-bg shadow-lg lg:shadow-none dark:shadow-border-dark`}
Expand Down Expand Up @@ -80,6 +80,12 @@ function Sidebar({ style, toggle }: { style: string; toggle: () => void }) {
<UserGroupIcon className="w-5" />
</SideNavLink>
</CheckRole>
{/* INVITATION*/}
<CheckRole roles={['admin', 'coordinator']}>
<SideNavLink onClick={toggle} to="/invitation" name="Invitation">
<FaEnvelopeOpenText className="w-5" />
</SideNavLink>
</CheckRole>

{/* FOR ADMINS */}
<CheckRole roles={['admin']}>
Expand Down
18 changes: 13 additions & 5 deletions src/containers/DashRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const LoginActivitiesTable = React.lazy(
const AdminTeams = React.lazy(() => import('./admin-dashBoard/Teams'));
const AdminCohorts = React.lazy(() => import('./admin-dashBoard/Cohorts'));
const AdminPrograms = React.lazy(() => import('./admin-dashBoard/Programs'));
const Invitation = React.lazy(() => import('../pages/Invitation'));
const AdminSession = React.lazy(() => import('./admin-dashBoard/Sessions'));
const AdminPhases = React.lazy(() => import('./admin-dashBoard/Phases'));
const AdminManageRoles = React.lazy(
Expand Down Expand Up @@ -85,7 +86,7 @@ function DashRoutes() {

const [nav, setNav] = useState(false);
const handleClick = () => setNav(!nav);

return (
<PrivateRoute>
<MenuProvider>
Expand All @@ -97,6 +98,13 @@ function DashRoutes() {
<Routes>
<Route path="/dashboard" element={<Dashboard />} />
<Route path="/trainees" element={<AdminTraineeDashboard />} />
<Route path="/invitation" element={
<>
<CheckRole roles={['admin']}>
<Invitation />
</CheckRole>
</>
} />
<Route path="/trainees/:userId" element={<ViewTraineeRatings />} />
<Route
path="/ratings"
Expand Down Expand Up @@ -148,10 +156,10 @@ function DashRoutes() {
<Route index element={<AllTickets />} />
<Route path=":ticketId" element={<Ticket />} />
</Route>
<Route path="/loginActivities" element={<LoginActivitiesTable />} />
<Route path="/team/:teamname" element={<TeamDetails/>} />

<Route path="/loginActivities" element={<LoginActivitiesTable />} />

<Route path="/team/:teamname" element={<TeamDetails />} />

<Route path="/team-cards" element={<ManagersCards />} />
<Route path="/cards" element={<CoordinatorCards />} />
Expand Down
Loading
Loading