Skip to content

Commit

Permalink
Add resource page
Browse files Browse the repository at this point in the history
  • Loading branch information
roshni73 committed Nov 13, 2024
1 parent 3d1ebe0 commit 1daeacf
Show file tree
Hide file tree
Showing 3 changed files with 166 additions and 69 deletions.
29 changes: 17 additions & 12 deletions src/views/Resources/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,21 @@
"resourceHeadingTitle": "Resources",
"resourceAlerthubTitle":"IFRC Alert Hub - Resources",
"resourceHeadingDescription":"Alert Hub is an open source web project developed in collaboration with the International Federation of Red Cross and Red Crescent Societies (IFRC) as a part of the University College London (UCL) Industry Exchange Network (IXN). You can find all the source code and instructions under the following repositories.",
"resourceAlertHubAPIs":"Alert Hub APIs",
"resourceAlertHubAPIsDescription":"Alert Hub APIs enable third-party developers and rebroadcasters to access alerts and alert feed.",
"resourceLearMore":"Learn More",
"resourceAlertHubFrontendTitle":"Alert Hub Frontend",
"resourceAlertHubFrontendDescription":"This repository contains the frontend code for the IFRC Alert Hub. The goal of the IFRC Alert Hub is to ensure that communities everywhere receive the most timely and effective emergency alerting possible, and can thereby take action to safeguard their lives and livelihoods.",
"resourceAlertHubCapAggregatorTitle":"Alert Hub CAP Aggregator",
"resourceAlertHubCapAggregatorDescription":"The CAP Aggregator is an alert aggregation service built for IFRC's Alert Hub. Public alerts use the Common Alerting Protocol (CAP) Version 1.2 standard.",
"resourceAlertHubAlertManagerTitle":"Alert Hub Alert Manager",
"resourceAlertHubAlertManagerDescription":"The Alert Manager is an alert distribution service built for IFRC's Alert Hub. Public alerts use the Common Alerting Protocol (CAP) Version 1.2 standard.",
"resourceAlertHubSubscriptionSystemTitle":"Alert Hub Subscription System",
"resourceAlertHubSubscriptionSystemDescription":"This project serves as a back-end application of IFRC Alert Hub designed to work with IFRC/UCL Alert Hub CAP Aggregator. This application relies on it to get real-time updates about alerts."
}
"earlyWarningResourcesTitle":"Early Warning Resources",
"earlyWarningResourceIfrcewea":"IFRC Early Warning, Early Action",
"earlyWarningResourceGdpcEws": "GDPC Early Warning Systems",
"earlyWarningResourceWmoCapCourse":"WMO Common Alerting Protocol Course",
"earlyWarningResourceIfrcPape":"IFRC PAPE Messages",
"faqSectionTitle":"FAQ",
"faqWhoIsTheAudience":"Who is the audience of the IFRC AlertHub?",
"faqWhoIsBehind":"Who is behind it?",
"faqHowToAccess":"How to access the API?",
"howToSubscribeTitle":"How to Subscribe?",
"howToSubscribeGo":"Go",
"howToSubscribeGdpc":"GDPC",
"howToSubscribeClimateCenter":"Climate Centre",
"howToSubscribeAnticipationHub":"Anticipation Hub'",
"ifrcRelatedLinksTitle":"IFRC related links:",
"ifrcRelatedExternalLinksTitle":"External links:"
}
}
174 changes: 134 additions & 40 deletions src/views/Resources/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ExternalLinkLineIcon } from '@ifrc-go/icons';
import { Container } from '@ifrc-go/ui';
import { useTranslation } from '@ifrc-go/ui/hooks';

Expand All @@ -11,72 +12,165 @@ import styles from './styles.module.css';
export function Component() {
const strings = useTranslation(i18n);

const resourceData = [
const earlyWarningResources = [
{
id: 1,
heading: strings.resourceAlertHubAPIs,
description: strings.resourceAlertHubAPIsDescription,
title: strings.earlyWarningResourceIfrcewea,
url: 'https://www.ifrc.org/our-work/disasters-climate-and-crises/climate-smart-disaster-risk-reduction/early-warning-early',
},
{
id: 2,
title: strings.earlyWarningResourceGdpcEws,
url: 'https://preparecenter.org/topic/early-warning-systems/',
},
{
id: 3,
title: strings.earlyWarningResourceWmoCapCourse,
url: 'https://etrp.wmo.int/course/view.php?id=157',
},
{
id: 4,
title: strings.earlyWarningResourceIfrcPape,
url: 'https://www.ifrc.org/our-work/disasters-climate-and-crises/climate-smart-disaster-risk-reduction/PAPE',
},
];
const frequentlyAskedQuestion = [
{
id: 1,
title: strings.faqWhoIsTheAudience,
url: 'https://alerthub.ifrc.org/about',
},
{
id: 2,
title: strings.faqWhoIsBehind,
url: 'https://alerthub.ifrc.org/feeds',
},
{
id: 3,
title: strings.faqHowToAccess,
url: 'https://github.com/IFRCGo/alert-hub-web-app/blob/develop/APIDOCS.md',
},

];
const ifrcResources = [
{
id: 1,
title: strings.howToSubscribeGo,
url: 'https://go.ifrc.org/',
},
{
id: 2,
heading: strings.resourceAlertHubFrontendTitle,
description: strings.resourceAlertHubFrontendDescription,
url: 'https://github.com/IFRCGo/alert-hub-web-app#readme',
title: strings.howToSubscribeGdpc,
url: 'https://preparecenter.org/',
},
{
id: 3,
heading: strings.resourceAlertHubCapAggregatorTitle,
description: strings.resourceAlertHubCapAggregatorDescription,
url: 'https://github.com/IFRC-Alert-Hub/Alert-Hub-CAP-Aggregator#readme',
title: strings.howToSubscribeClimateCenter,
url: 'https://www.climatecentre.org/',
},
{
id: 4,
heading: strings.resourceAlertHubAlertManagerTitle,
description: strings.resourceAlertHubAlertManagerDescription,
url: 'https://github.com/IFRC-Alert-Hub/Alert-Hub-Alert-Manager#readme',
title: strings.howToSubscribeAnticipationHub,
url: 'https://www.anticipation-hub.org/',
},
];
const externalResources = [
{
id: 1,
title: strings.howToSubscribeGo,
url: 'https://alertingauthority.wmo.int/',
},
{
id: 2,
title: strings.howToSubscribeGdpc,
url: 'https://cap-workshop.alert-hub.org/2023/index.html',
},
{
id: 3,
title: strings.howToSubscribeClimateCenter,
url: 'https://support.google.com/publicalerts/?hl=en',
},
{
id: 5,
heading: strings.resourceAlertHubSubscriptionSystemTitle,
description: strings.resourceAlertHubSubscriptionSystemDescription,
url: 'https://github.com/IFRC-Alert-Hub/Alert-Hub-Subscription-System#readme',
id: 4,
title: strings.howToSubscribeAnticipationHub,
url: 'https://www.un.org/en/climatechange/early-warnings-for-all',
},
];

return (
<Page
className={styles.resources}
mainSectionClassName={styles.resources}
title={strings.resourceAlerthubTitle}
heading={strings.resourceHeadingTitle}
description={strings.resourceHeadingDescription}
>
<Container
headingLevel={2}
contentViewType="grid"
numPreferredGridContentColumns={2}
spacing="relaxed"
heading={strings.earlyWarningResourcesTitle}
>
{earlyWarningResources.map((resource) => (
<Link
className={styles.resourceLink}
key={resource.id}
href={resource.url}
actions={<ExternalLinkLineIcon />}
external
>
{resource.title}
</Link>
))}
</Container>
<Container
heading={strings.faqSectionTitle}
>
{resourceData.map(
(resource) => (
<Container
className={styles.resourcesCard}
heading={resource.heading}
footerContent={(
<Link
href={resource.url}
className={styles.resourcesItem}
rel="noopener noreferrer"
external
>
{strings.resourceLearMore}
</Link>
)}
{frequentlyAskedQuestion.map((faq) => (
<Link
className={styles.resourceLink}
key={faq.id}
href={faq.url}
actions={<ExternalLinkLineIcon />}
external
>
{faq.title}
</Link>
))}
</Container>
<Container
heading={strings.howToSubscribeTitle}
>
<Container
headingDescription={strings.ifrcRelatedLinksTitle}
headingDescriptionContainerClassName={styles.headingDescription}
>

{ifrcResources.map((externalLink) => (
<Link
className={styles.resourceLink}
key={externalLink.id}
href={externalLink.url}
actions={<ExternalLinkLineIcon />}
external
>
{externalLink.title}
</Link>
))}
</Container>
<Container
headingDescription={strings.ifrcRelatedExternalLinksTitle}
headingDescriptionContainerClassName={styles.headingDescription}
>

{externalResources.map((externalLink) => (
<Link
className={styles.resourceLink}
key={externalLink.id}
href={externalLink.url}
actions={<ExternalLinkLineIcon />}
external
>
{resource.description}
</Container>
),
)}
{externalLink.title}
</Link>
))}
</Container>
</Container>
</Page>
);
Expand Down
32 changes: 15 additions & 17 deletions src/views/Resources/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
.resources {
.resources-card {
display: flex;
flex-direction: column;
gap: var(--go-ui-spacing-sm);
border-radius: var(--go-ui-border-radius-lg);
box-shadow: var(--go-ui-box-shadow-md);
padding: var(--go-ui-spacing-md);

.resources-item {
text-decoration: none;
color: var(--go-ui-color-primary-red);
font-weight: var(--go-ui-font-weight-medium);
}
display: flex;
flex-direction: column;
gap: var(--go-ui-spacing-xl);

.resources-item:hover {
text-decoration: underline;
color: var(--go-ui-color-primary-red);
}
.resource-link{
display: flex;
padding-bottom: var(--go-ui-spacing-md);
text-decoration: none;
font-weight: var(--go-ui-font-weight-normal);
}
.resource-link:hover {
text-decoration: underline;
color: var(--go-ui-color-red-hover);
}
.heading-description{
font-size: var(--go-ui-font-size-lg);
}
}

0 comments on commit 1daeacf

Please sign in to comment.