Skip to content

Commit 0a71414

Browse files
barshathakurishreeyash07
authored andcommitted
eap(add-eap-link): Add EAP Tab in account page
1 parent 8d799b0 commit 0a71414

File tree

8 files changed

+131
-1
lines changed

8 files changed

+131
-1
lines changed

app/src/App/routes/index.tsx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,50 @@ const accountMyFormsThreeW = customWrapRoute({
728728
},
729729
});
730730

731+
const accountMyFormsEap = customWrapRoute({
732+
parent: accountMyFormsLayout,
733+
path: 'eap-applications',
734+
component: {
735+
render: () => import('#views/EapApplications'),
736+
props: {},
737+
},
738+
context: {
739+
title: 'Account - EAP Applications',
740+
visibility: 'is-authenticated',
741+
permissions: ({ isGuestUser }) => !isGuestUser,
742+
},
743+
});
744+
745+
const eapFullForm = customWrapRoute({
746+
parent: rootLayout,
747+
path: 'eap-full-form',
748+
component: {
749+
render: () => import('#views/EapFullForm'),
750+
props: {},
751+
},
752+
wrapperComponent: Auth,
753+
context: {
754+
title: 'EAP Full Forms',
755+
visibility: 'is-authenticated',
756+
permissions: ({ isGuestUser }) => !isGuestUser,
757+
},
758+
});
759+
760+
const simplifiedEapForm = customWrapRoute({
761+
parent: rootLayout,
762+
path: 'simplified-eap-form',
763+
component: {
764+
render: () => import('#views/SimplifiedEapForm'),
765+
props: {},
766+
},
767+
wrapperComponent: Auth,
768+
context: {
769+
title: 'Simplified EAP Forms',
770+
visibility: 'is-authenticated',
771+
permissions: ({ isGuestUser }) => !isGuestUser,
772+
},
773+
});
774+
731775
const accountNotifications = customWrapRoute({
732776
parent: accountLayout,
733777
path: 'notifications',
@@ -1344,6 +1388,7 @@ const wrappedRoutes = {
13441388
accountMyFormsPer,
13451389
accountMyFormsDref,
13461390
accountMyFormsThreeW,
1391+
accountMyFormsEap,
13471392
resources,
13481393
search,
13491394
allThreeWProject,
@@ -1381,6 +1426,8 @@ const wrappedRoutes = {
13811426
operationalLearning,
13821427
montandonLandingPage,
13831428
eapDevelopmentRegistration,
1429+
eapFullForm,
1430+
simplifiedEapForm,
13841431
...regionRoutes,
13851432
...countryRoutes,
13861433
...surgeRoutes,

app/src/views/AccountMyFormsLayout/i18n.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"fieldReportTabTitle": "Field Report",
55
"perTabTitle": "PER",
66
"drefTabTitle": "DREF",
7-
"threeWTabTitle": "3W"
7+
"threeWTabTitle": "3W",
8+
"eapApplications": "EAP Applications"
89
}
910
}

app/src/views/AccountMyFormsLayout/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ export function Component() {
3535
>
3636
{strings.threeWTabTitle}
3737
</NavigationTab>
38+
<NavigationTab
39+
to="accountMyFormsEap"
40+
>
41+
{strings.eapApplications}
42+
</NavigationTab>
3843
</NavigationTabList>
3944
<Outlet />
4045
</div>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"namespace": "eapApplication",
3+
"strings": {
4+
"eapRegistrationLink": "EAP In Process? Let Us Know",
5+
"eapFormLink": "Start Full EAP",
6+
"simplifiedEapLink": "Start sEAP"
7+
}
8+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { Container } from '@ifrc-go/ui';
2+
import { useTranslation } from '@ifrc-go/ui/hooks';
3+
4+
import Link from '#components/Link';
5+
6+
import i18n from './i18n.json';
7+
import styles from './styles.module.css';
8+
9+
/** @knipignore */
10+
// eslint-disable-next-line import/prefer-default-export
11+
export function Component() {
12+
const strings = useTranslation(i18n);
13+
14+
return (
15+
<Container
16+
childrenContainerClassName={styles.eapFormLinks}
17+
>
18+
{/* FIXME: Add eap registration link */}
19+
<Link
20+
to="home"
21+
variant="secondary"
22+
>
23+
{strings.eapRegistrationLink}
24+
</Link>
25+
<Link
26+
to="eapFullForm"
27+
variant="secondary"
28+
>
29+
{strings.eapFormLink}
30+
</Link>
31+
<Link
32+
to="simplifiedEapForm"
33+
variant="secondary"
34+
>
35+
{strings.simplifiedEapLink}
36+
</Link>
37+
</Container>
38+
);
39+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.eap-form-links {
2+
display: flex;
3+
align-items: center;
4+
justify-content: center;
5+
gap: var(--go-ui-spacing-sm);
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Page from '#components/Page';
2+
3+
/** @knipignore */
4+
// eslint-disable-next-line import/prefer-default-export
5+
export function Component() {
6+
return (
7+
<Page>
8+
{/* TODO: Add EAP form */}
9+
Full EAP Form
10+
</Page>
11+
);
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import Page from '#components/Page';
2+
3+
/** @knipignore */
4+
// eslint-disable-next-line import/prefer-default-export
5+
export function Component() {
6+
return (
7+
<Page>
8+
{/* TODO: Add Simplified EAP form */}
9+
Simplified EAP form
10+
</Page>
11+
);
12+
}

0 commit comments

Comments
 (0)