Skip to content

Commit

Permalink
new ind field from jobs to trainings
Browse files Browse the repository at this point in the history
  • Loading branch information
mluena committed Dec 18, 2024
1 parent 8eb3449 commit b6b7756
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
2 changes: 2 additions & 0 deletions client/src/containers/countries/detail/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export const COLUMNS = [
'forest_area_pct',
'intervention_area_total',
'jobs',
'total_trainings',
'trainees',
'jobs_total',
'net_flux_co2e_year',
'production_ntfp_total',
Expand Down
20 changes: 11 additions & 9 deletions client/src/containers/countries/detail/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ export default function CountryDetailPanel() {
</div>
<div className="w-full rounded-xl bg-white p-4 shadow-sm">
<div className="flex items-center justify-between pb-2">
<h3 className="text-base text-green-800">Total jobs</h3>
<h3 className="text-base text-green-800">Total trainings</h3>
<Tooltip delayDuration={200}>
<TooltipTrigger className="flex items-center justify-center rounded-full p-2 hover:bg-yellow-50 data-[state=open]:bg-yellow-50">
<Info className="text-green-800" size={20} />
Expand All @@ -444,24 +444,26 @@ export default function CountryDetailPanel() {
<TooltipContent className="max-w-[200px] p-2">
<p className="text-sm text-yellow-900">
<Markdown remarkPlugins={[remarkGfm]} className="prose text-xs">
The total number of short- and long-term jobs generated by the
project interventions in the AFoCO Member Countries.
The total number of training activities conducted and participants
in the AFoCO Member Countries.
</Markdown>
</p>
</TooltipContent>
</Tooltip>
</div>

<p className="py-4 text-3xl font-extrabold">
{formatCompactNumber(indicators.jobs_total['value'])}
{formatCompactNumber(indicators.trainings_total['value'])}
</p>
{indicators.jobs && (
{indicators.trainees && (
<div className="h-44">
<BarsChart
data={Object.entries(indicators.jobs['value']).map(([year, uv]) => ({
year,
uv,
}))}
data={Object.entries(indicators.trainees['value']).map(
([year, uv]) => ({
year,
uv,
})
)}
barDataKey="uv"
barRadius={[20, 20, 20, 20]}
fillBar="#70B6CC"
Expand Down
12 changes: 6 additions & 6 deletions client/src/containers/projects/detail/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default function ProjectDashboard({ id }: { id: string }) {

<div className="w-1/2 rounded-xl bg-white p-4 shadow-sm">
<div className="flex items-center justify-between">
<h3 className="text-lg text-green-800">Total jobs</h3>
<h3 className="text-lg text-green-800">Total trainings</h3>
<Tooltip>
<TooltipTrigger className="flex items-center justify-center rounded-full p-2 hover:bg-yellow-50 data-[state=open]:bg-yellow-50">
<Info className="text-green-800" size={20} />
Expand All @@ -220,20 +220,20 @@ export default function ProjectDashboard({ id }: { id: string }) {
<TooltipContent className="max-w-[200px] p-2" align="start" side="left">
<p className="text-sm text-yellow-900">
<Markdown remarkPlugins={[remarkGfm]} className="prose text-xs">
The total number of short- and long-term jobs generated by the project
interventions in the AFoCO Member Countries.
The total number of training activities conducted and participants in the
AFoCO Member Countries.
</Markdown>
</p>
</TooltipContent>
</Tooltip>
</div>
<p className="py-4 text-3xl font-extrabold">
{formatCompactNumber(data.jobs_total['value']) || 0}
{formatCompactNumber(data.trainings_total['value']) || 0}
</p>
<div className="h-32">
{data.jobs && (
{data.trainees && (
<BarsChart
data={Object.entries(data.jobs['value']).map(([year, uv]) => ({
data={Object.entries(data.trainees['value']).map(([year, uv]) => ({
year,
uv,
}))}
Expand Down
14 changes: 7 additions & 7 deletions client/src/containers/projects/stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default function Stats() {
},
}
);

console.log(data);
return (
<ContentLoader
data={data}
Expand Down Expand Up @@ -190,28 +190,28 @@ export default function Stats() {
<div className="flex flex-col space-y-2">
<div className="w-full rounded-xl bg-white p-4 shadow-sm">
<div className="flex items-center justify-between">
<h3 className="text-base text-green-800">Total jobs</h3>
<h3 className="text-base text-green-800">Total trainings</h3>
<Tooltip>
<TooltipTrigger className="flex items-center justify-center rounded-full p-2 hover:bg-yellow-50 data-[state=open]:bg-yellow-50">
<Info className="text-green-800" size={20} />
</TooltipTrigger>
<TooltipContent className="max-w-[200px] p-2">
<p className="text-sm text-yellow-900">
<Markdown remarkPlugins={[remarkGfm]} className="prose text-xs">
The total number of short- and long-term jobs generated by the
project interventions in the AFoCO Member Countries.
The total number of training activities conducted and participants
in the AFoCO Member Countries.
</Markdown>
</p>
</TooltipContent>
</Tooltip>
</div>
<p className="py-4 text-3xl font-extrabold">
{formatCompactNumber(data.jobs_total['value'])}
{formatCompactNumber(data.trainings_total['value'])}
</p>{' '}
<div className="h-44">
{data.jobs && (
{data.trainees && (
<BarsChart
data={Object.entries(data.jobs['value']).map(([year, uv]) => ({
data={Object.entries(data.trainees['value']).map(([year, uv]) => ({
year,
uv,
}))}
Expand Down

0 comments on commit b6b7756

Please sign in to comment.