-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show confirmation before sending mentorship request (#84)
* Show confirmation before sending mentorship request * Fix tests * Show toast after sending email * OOps * Add report page to mentor * Get the last reportId when sending request to mentor
- Loading branch information
Showing
14 changed files
with
297 additions
and
80 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
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
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
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
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,52 @@ | ||
import React from "react"; | ||
import Stats from "@/components/Stats"; | ||
import { calcScore } from "@/lib/score"; | ||
import ResultsByDimension from "@/components/ResultsByDimension"; | ||
import { Evaluation, Report } from "@/redux/api/types"; | ||
|
||
const ReportResults = ({ | ||
report, | ||
evaluationsCompleted, | ||
scoreByEvaluation, | ||
}: { | ||
report: Report; | ||
evaluationsCompleted: Evaluation[]; | ||
scoreByEvaluation?: { | ||
id: string; | ||
name: string; | ||
score: number; | ||
tags: string[]; | ||
}[]; | ||
}) => { | ||
const startDate = new Date(report.createdAt).getTime(); | ||
const endDate = new Date(report.deadline).getTime(); | ||
|
||
const period = Math.ceil( | ||
Math.abs(endDate - startDate) / (1000 * 60 * 60 * 24) | ||
); | ||
return ( | ||
<div> | ||
<Stats | ||
data={[ | ||
{ | ||
label: "Perioadă de completare", | ||
value: `${period} zile`, | ||
}, | ||
{ | ||
label: "Total completări", | ||
value: `${evaluationsCompleted.length || 0}`, | ||
}, | ||
{ | ||
label: " Scor total", | ||
value: `${calcScore(evaluationsCompleted) || 0}%`, | ||
}, | ||
]} | ||
/> | ||
{scoreByEvaluation && ( | ||
<ResultsByDimension scoreByEvaluation={scoreByEvaluation} /> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ReportResults; |
Oops, something went wrong.
05e6f79
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
crestem-ong – ./
crestem-ong-git-main-code4romania.vercel.app
app.crestem.ong
crestem-ong-code4romania.vercel.app