-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feature: improve trainee details page * handling missing application info, also adding download functionality * fixing error related to download and refactoring * Update TrainneeDetails.tsx * handling issues related to deployment * Fix number can't be shared (#130) Co-authored-by: Mugisha <[email protected]> * #102 sidebar links review (#128) * fix: remove placeholder property * fix duplicate links --------- Co-authored-by: ceelogre <[email protected]> * Ft minimize dashboard menu #110 (#140) * fix: remove placeholder property * ft minimize dashboard menu * fix minimize dashboard by icon and categorize into section * fix minimize dashboard by icon and categorize into section * fix minimize dashboard by icon and categorize into section * fix minimize dashboard by icon and categorize into section * fix minimize dashboard by icon and categorize into section * fix minimize dashboard by icon and categorize into section * fix minimize dashboard scrollbar * fix minimize dashboard scrollbar * fix minimize dashboard scrollbar * Fix layout spacing between sidebar and main content in AdminLayout * new * Fix layout spacing between sidebar and main content in AdminLayout * fix layout --------- Co-authored-by: ceelogre <[email protected]> Co-authored-by: Prince-Kid <[email protected]> Co-authored-by: Mucyo Prince <[email protected]> Co-authored-by: Aime-Patrick <[email protected]> * #118 fx: builtinSuperAdminCreateProgram (#126) * fix: remove placeholder property * The built-in superadmin account cannot create a program --------- Co-authored-by: ceelogre <[email protected]> * feature: improve trainee details page * handling missing application info, also adding download functionality * Update TrainneeDetails.tsx * adding way to send email and other adjustments * refining and fixing some issues * Update webpack.config.js * customizing way of sending email * refactoring code to fix issue related to code climate * fixing issue for deployment * fixing issues related to refactoring --------- Co-authored-by: MUGISHA Emmanuel <[email protected]> Co-authored-by: Mugisha <[email protected]> Co-authored-by: ISHIMWE Jean Baptiste <[email protected]> Co-authored-by: ceelogre <[email protected]> Co-authored-by: ManziPatrick <[email protected]> Co-authored-by: Prince-Kid <[email protected]> Co-authored-by: Mucyo Prince <[email protected]> Co-authored-by: Aime-Patrick <[email protected]> Co-authored-by: Niyonshuti Jean De Dieu <[email protected]>
- Loading branch information
1 parent
5088aa5
commit e30941c
Showing
12 changed files
with
392 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ coverage | |
dist | ||
buildcoverage | ||
package-lock.json | ||
.DS_Store | ||
.DS_Store | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from "react"; | ||
|
||
interface DetailItemProps { | ||
title: string; | ||
value: string | number | boolean; | ||
} | ||
|
||
const DetailItem: React.FC<DetailItemProps> = ({ title, value }) => { | ||
return ( | ||
<div className="w-72 bg-slate-300 pl-2 py-2 mb-3 rounded-md dark:bg-gray-800 dark:text-white"> | ||
<h3 className="pb-1">{title}</h3> | ||
<p className="text-gray-500 text-sm dark:text-gray-400"> | ||
{String(value)} | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DetailItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from "react"; | ||
|
||
import { IconType } from "react-icons"; | ||
|
||
interface ProgramItemProps { | ||
title: string; | ||
value: string | number | boolean; | ||
Icon: IconType; | ||
} | ||
|
||
const ProgramItem: React.FC<ProgramItemProps> = ({ title, value,Icon }) => { | ||
return ( | ||
<div className="ml-5 flex items-center gap-4"> | ||
<Icon size={50} /> | ||
<div> | ||
<h3 className="pb-2">{title}</h3> | ||
<p className="text-gray-500 text-sm">{value}</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ProgramItem; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import React from "react"; | ||
import { DownloadPdf } from "../../utils/DownloadPdf"; | ||
|
||
interface TraineeDetails { | ||
interview_decision: string; | ||
trainee_id: { | ||
email: string; | ||
lastName: string; | ||
firstName: string; | ||
}; | ||
} | ||
|
||
interface DecisionButtonProps { | ||
decision: string; | ||
} | ||
|
||
const getDecisionDetails = (decision: string) => { | ||
switch (decision) { | ||
case "Passed": | ||
case "Approved": | ||
return { | ||
text: "Passed", | ||
style: "bg-[#56C870] hover:bg-[#67dc82] dark:hover:bg-[#1f544cef] dark:bg-[#56C870]", | ||
}; | ||
case "Failed": | ||
case "Rejected": | ||
return { | ||
text: "Failed", | ||
style: "bg-red-800 hover:bg-red-500", | ||
}; | ||
default: | ||
return { | ||
text: "No Decision", | ||
style: "bg-gray-400", | ||
}; | ||
} | ||
}; | ||
|
||
const DecisionButton: React.FC<DecisionButtonProps> = ({ decision }) => { | ||
const { text, style } = getDecisionDetails(decision); | ||
|
||
return ( | ||
<span className={`btn-Aprov h-11 ${style} text-white font-bold py-3 px-5 rounded`}> | ||
{text} | ||
</span> | ||
); | ||
}; | ||
|
||
const DecisionSection: React.FC<{ traineeDetails: TraineeDetails }> = ({ traineeDetails }) => { | ||
const { interview_decision, trainee_id } = traineeDetails; | ||
|
||
return ( | ||
<div className="w-full py-7 flex flex-col mx-16 bg-slate-200 rounded-xl shadow-md overflow-hidden md:max-w-2xl lg:flex lg:max-w-3xl dark:bg-[#192432] dark:text-white"> | ||
<h2 className="font-bold text-lg text-[#56C870] top-5 ml-5 mt-[-10px] pb-2 uppercase"> | ||
Status | ||
</h2> | ||
<div className="h-16 flex pl-6 items-center gap-5"> | ||
<DecisionButton decision={interview_decision} /> | ||
<button | ||
onClick={() => DownloadPdf()} | ||
className="btn-Aprov h-11 bg-blue-700 hover:bg-blue-600 dark:hover:bg-blue-600 text-white font-bold py-2 px-2 rounded dark:bg-blue-700" | ||
> | ||
Download PDF | ||
</button> | ||
<button className="btn-Aprov h-11 bg-blue-500 hover:bg-blue-600 dark:hover:bg-blue-600 text-white font-bold py-2 px-8 rounded dark:bg-blue-500"> | ||
<a | ||
href={`https://mail.google.com/mail/?view=cm&fs=1&to=${trainee_id?.email}&su=Your%20ATLP%20Application%20Email&body=Dear%20${trainee_id?.lastName} ${trainee_id?.firstName},`} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
</a> | ||
</button> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default DecisionSection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.