-
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.
Merge pull request #1055 from Vizzuality/feat/front/MARXAN-1516-pdf-r…
…evision feat(front): pdf revision [MARXAN-1516]
- Loading branch information
Showing
15 changed files
with
237 additions
and
49 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
125 changes: 125 additions & 0 deletions
125
app/layout/scenarios/reports/solutions/intro-page/component.tsx
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,125 @@ | ||
import React from 'react'; | ||
|
||
import { useRouter } from 'next/router'; | ||
|
||
import { format } from 'date-fns'; | ||
|
||
import { useProjectUsers } from 'hooks/project-users'; | ||
import { useProject } from 'hooks/projects'; | ||
import { useScenario } from 'hooks/scenarios'; | ||
|
||
import LOGO_BLACK from 'svgs/logo-black.svg'; | ||
|
||
export interface IntroPageProps { | ||
|
||
} | ||
|
||
export const IntroPage: React.FC<IntroPageProps> = () => { | ||
const { query } = useRouter(); | ||
const { pid, sid } = query; | ||
|
||
const { | ||
data: projectData, | ||
isFetched: projectDataIsFetched, | ||
} = useProject(pid); | ||
|
||
const { | ||
data: scenarioData, | ||
isFetched: scenarioDataIsFetched, | ||
} = useScenario(sid); | ||
|
||
const { | ||
data: projectUsers, | ||
isFetched: projectUsersAreFetched, | ||
} = useProjectUsers(pid); | ||
|
||
const projectOwner = projectUsers?.find((u) => u.roleName === 'project_owner')?.user || {}; | ||
|
||
const reportDataIsFetched = projectDataIsFetched | ||
&& scenarioDataIsFetched && projectUsersAreFetched; | ||
|
||
const { | ||
description, name, planningAreaName, planningUnitGridShape, planningUnitAreakm2, | ||
} = projectData || {}; | ||
|
||
return ( | ||
reportDataIsFetched && ( | ||
<div className="pt-6 space-y-6"> | ||
<div className="flex justify-between"> | ||
<div> | ||
<div className="flex space-x-1 text-xs"> | ||
<p className="font-semibold uppercase"> | ||
Created by: | ||
</p> | ||
<p className="capitalize">{projectOwner?.displayName || projectOwner?.email}</p> | ||
</div> | ||
<h1 className="pb-2 text-2xl font-semibold text-gray-500 font-heading"> | ||
Solution Report | ||
</h1> | ||
</div> | ||
<img | ||
className="w-32 h-12" | ||
alt="Marxan logo" | ||
src={LOGO_BLACK} | ||
/> | ||
</div> | ||
<section className="w-1/2 space-y-8 text-xs"> | ||
<div className="flex flex-col space-y-3 text-xs"> | ||
<div className="flex space-x-1"> | ||
<p className="font-semibold">Project:</p> | ||
<p> | ||
{name} | ||
</p> | ||
</div> | ||
|
||
<div className="flex space-x-1"> | ||
<p className="font-semibold">Scenario:</p> | ||
<p> | ||
{scenarioData?.name} | ||
</p> | ||
</div> | ||
|
||
<div className="flex space-x-1"> | ||
<p className="font-semibold">Description:</p> | ||
<p> | ||
{description} | ||
</p> | ||
</div> | ||
|
||
<div className="flex space-x-1"> | ||
<p className="font-semibold">Planning Area:</p> | ||
<p> | ||
{planningAreaName || 'Custom'} | ||
</p> | ||
</div> | ||
|
||
<div className="flex space-x-1"> | ||
<p className="font-semibold">Planning Unit Area:</p> | ||
<p> | ||
{planningUnitAreakm2 ? `${planningUnitAreakm2} | ||
km2` : 'Custom'} | ||
</p> | ||
</div> | ||
<div className="flex space-x-1"> | ||
<p className="font-semibold">Planning Unit Grid Shape:</p> | ||
<p> | ||
{(planningUnitGridShape === 'hexagon' || planningUnitGridShape === 'square') ? planningUnitGridShape : 'Custom'} | ||
</p> | ||
</div> | ||
|
||
<div className="flex space-x-1"> | ||
<p className="font-semibold">Marxan platform version:</p> | ||
<p> V.0.0.1</p> | ||
</div> | ||
<div className="flex space-x-1"> | ||
<p className="font-semibold">Date:</p> | ||
<p>{format(new Date().getTime(), 'MM/dd/yyyy')}</p> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
) | ||
); | ||
}; | ||
|
||
export default IntroPage; |
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions
1
app/layout/scenarios/reports/solutions/solution-frequency-page/map/index.ts
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 @@ | ||
export { default } from './component'; |
Oops, something went wrong.