Skip to content

Commit 8d799b0

Browse files
barshathakurishreeyash07
authored andcommitted
global(add-global-page): Add a global page
1 parent 85c2f97 commit 8d799b0

File tree

8 files changed

+154
-0
lines changed

8 files changed

+154
-0
lines changed

app/src/App/routes/index.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,19 @@ const accountMyFormsDref = customWrapRoute({
701701
},
702702
});
703703

704+
const earlyActionProtocols = customWrapRoute({
705+
parent: rootLayout,
706+
path: 'eap',
707+
component: {
708+
render: () => import('#views/EarlyActionProtocols'),
709+
props: {},
710+
},
711+
context: {
712+
title: 'Early Action Protocols',
713+
visibility: 'anything',
714+
},
715+
});
716+
704717
const accountMyFormsThreeW = customWrapRoute({
705718
parent: accountMyFormsLayout,
706719
path: 'three-w',
@@ -1145,6 +1158,21 @@ const newPerOverviewForm = customWrapRoute({
11451158
},
11461159
});
11471160

1161+
const eapDevelopmentRegistration = customWrapRoute({
1162+
parent: rootLayout,
1163+
path: 'eap-registration/new',
1164+
component: {
1165+
render: () => import('#views/EapRegistration'),
1166+
props: {},
1167+
},
1168+
wrapperComponent: Auth,
1169+
context: {
1170+
title: 'EAP Development Registration',
1171+
visibility: 'is-authenticated',
1172+
permissions: ({ isGuestUser }) => !isGuestUser,
1173+
},
1174+
});
1175+
11481176
const perOverviewForm = customWrapRoute({
11491177
parent: perProcessLayout,
11501178
path: ':perId/overview',
@@ -1352,6 +1380,7 @@ const wrappedRoutes = {
13521380
termsAndConditions,
13531381
operationalLearning,
13541382
montandonLandingPage,
1383+
eapDevelopmentRegistration,
13551384
...regionRoutes,
13561385
...countryRoutes,
13571386
...surgeRoutes,
@@ -1362,6 +1391,7 @@ const wrappedRoutes = {
13621391
// Redirects
13631392
preparednessOperationalLearning,
13641393
obsoleteFieldReportDetails,
1394+
earlyActionProtocols,
13651395
};
13661396

13671397
export const unwrappedRoutes = unwrapRoute(Object.values(wrappedRoutes));

app/src/components/Navbar/i18n.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"userMenuDrefProcessDescription":"Disaster Response Emergency Fund (DREF) is the quickest way of getting funding directly to local humanitarian actors. Use one of the links below to submit a DREF Application or an update.",
4141
"userMenuCreateDrefApplication":"Create DREF Application",
4242
"myDrefApplications": "My DREF Applications",
43+
"earlyActionProtocols": "Early Action Protocols (EAP)",
4344
"userMenuSurge":"The section displays the summary of deployments within current and ongoing emergencies. Login to see available details",
4445
"userMenuSurgeGlobalOverview":"Surge Global Overview",
4546
"userMenuOperationalToolbox":"Operational Toolbox",

app/src/components/Navbar/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,13 @@ function Navbar(props: Props) {
351351
>
352352
{strings.myDrefApplications}
353353
</DropdownMenuItem>
354+
<DropdownMenuItem
355+
type="link"
356+
to="earlyActionProtocols"
357+
variant="tertiary"
358+
>
359+
{strings.earlyActionProtocols}
360+
</DropdownMenuItem>
354361
<DropdownMenuItem
355362
type="link"
356363
to="newDrefApplicationForm"
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"namespace": "eapRegistration",
3+
"strings": {
4+
"eapRegistrationHeading": "EAP Development Registration",
5+
"eapRegistrationDescription": "The purpose of this form is for you to notify the IFRC team of the start of your EAP process. If you need assistance with the initiation of the process, send us a message."
6+
}
7+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { useTranslation } from '@ifrc-go/ui/hooks';
2+
3+
import Page from '#components/Page';
4+
5+
import i18n from './i18n.json';
6+
7+
/** @knipignore */
8+
// eslint-disable-next-line import/prefer-default-export
9+
export function Component() {
10+
const strings = useTranslation(i18n);
11+
12+
return (
13+
<Page
14+
heading={strings.eapRegistrationHeading}
15+
description={strings.eapRegistrationDescription}
16+
>
17+
{/* TODO: Add the form */}
18+
Application Details
19+
</Page>
20+
);
21+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"namespace": "earlyActionProtocols",
3+
"strings": {
4+
"eapHeading": "Disaster Response Emergency Fund (DREF)",
5+
"eapDescription": "The IFRC's Disaster Emergency Fund (DREF): rapid, reliable funding for life-saving action.",
6+
"eapTitle": "Early Action Protocols (EAP)",
7+
"eapRegistrationLink": "EAP in Progress? Let Us Know",
8+
"eapContent": "What is an EAP?",
9+
"eapContentHeading": "Early Action Protocols (EAPs) are a core mechanism of the IFRC's Forecast-based Financing (FbF) approach, designed to ensure that humanitarian action happens before a disaster strikes, rather than only responding afterwards.",
10+
"eapContentSubHeadingOne": "An EAP is a pre-agreed plan developed by a Nation Society together with partners, which outlines:",
11+
"eapDescriptionOne": "The triggers (based on scientific forecasts and risk analysis) that indicate when a hazard is likely to impact communities.",
12+
"eapDescriptionTwo": "The early actions to be implemented once those triggers are met - practical, life-saving measures that reduce the impacts of the forecasted disaster.",
13+
"eapDescriptionThree": "The roles, responsibilities, and budget required to carry out these actions quickly and effectively.",
14+
"eapContentSubHeadingTwo": "Why are the EAPs Important?",
15+
"eapContentSubHeadingThree": "What is the EAP Application Process?"
16+
}
17+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import {
2+
Container,
3+
ExpandableContainer,
4+
} from '@ifrc-go/ui';
5+
import { useTranslation } from '@ifrc-go/ui/hooks';
6+
7+
import Link from '#components/Link';
8+
import Page from '#components/Page';
9+
10+
import i18n from './i18n.json';
11+
import styles from './styles.module.css';
12+
13+
/** @knipignore */
14+
// eslint-disable-next-line import/prefer-default-export
15+
export function Component() {
16+
const strings = useTranslation(i18n);
17+
18+
return (
19+
<Page
20+
heading={strings.eapHeading}
21+
description={strings.eapDescription}
22+
>
23+
<Container
24+
heading={strings.eapTitle}
25+
actions={(
26+
<Link
27+
to="eapDevelopmentRegistration"
28+
variant="primary"
29+
>
30+
{strings.eapRegistrationLink}
31+
</Link>
32+
)}
33+
childrenContainerClassName={styles.earlyActionProtocols}
34+
>
35+
<ExpandableContainer
36+
heading={strings.eapContent}
37+
>
38+
<p>
39+
{strings.eapContentHeading}
40+
</p>
41+
<p>
42+
{strings.eapContentSubHeadingOne}
43+
<ul>
44+
<li>
45+
{strings.eapDescriptionOne}
46+
</li>
47+
<li>
48+
{strings.eapDescriptionTwo}
49+
</li>
50+
<li>
51+
{strings.eapDescriptionThree}
52+
</li>
53+
</ul>
54+
</p>
55+
</ExpandableContainer>
56+
{/* TODO: Add remaining content */}
57+
<ExpandableContainer
58+
heading={strings.eapContentSubHeadingTwo}
59+
/>
60+
<ExpandableContainer
61+
heading={strings.eapContentSubHeadingThree}
62+
/>
63+
</Container>
64+
</Page>
65+
);
66+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.early-action-protocols {
2+
display: flex;
3+
flex-direction: column;
4+
gap: var(--go-ui-spacing-lg);
5+
}

0 commit comments

Comments
 (0)