Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource page #158

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 23 additions & 14 deletions src/views/Resources/i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@
"namespace": "resources",
"strings": {
"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."
}
"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.",
"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?",
"ifrcRelatedLinksTitle": "IFRC related links:",
"ifrcRelatedLinksGo": "GO",
"ifrcRelatedLinksGdpc": "GDPC",
"ifrcRelatedLinksClimateCenter": "Climate Centre",
"ifrcRelatedLinksAnticipationHub": "Anticipation Hub",
"ifrcRelatedExternalLinksTitle": "External links:",
"ifrcRelatedExternalLinksGo": "WMO register of alerting authorities",
"ifrcRelatedExternalLinksCapImplementation": "CAP implementation workshop",
"ifrcRelatedExternalLinksGooglePublicAlerts": "Google Public Alerts",
"ifrcRelatedExternalLinksEarlyWarningAllInitiative":"Early Warning For All Initiative"
}
}
172 changes: 131 additions & 41 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,161 @@ 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.ifrcRelatedLinksGo,
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.ifrcRelatedLinksGdpc,
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.ifrcRelatedLinksClimateCenter,
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.ifrcRelatedLinksAnticipationHub,
url: 'https://www.anticipation-hub.org/',
},
];
const externalResources = [
{
id: 1,
title: strings.ifrcRelatedExternalLinksGo,
url: 'https://alertingauthority.wmo.int',
},
{
id: 2,
title: strings.ifrcRelatedExternalLinksCapImplementation,
url: 'https://cap-workshop.alert-hub.org/2023/index.html',
},
{
id: 3,
title: strings.ifrcRelatedExternalLinksGooglePublicAlerts,
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.ifrcRelatedExternalLinksEarlyWarningAllInitiative,
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}
>
{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>
)}
>
{resource.description}
</Container>
),
)}
{earlyWarningResources.map((resource) => (
<Link
className={styles.resourceLink}
key={resource.id}
href={resource.url}
actions={<ExternalLinkLineIcon />}
external
>
{resource.title}
</Link>
))}
</Container>
<Container
heading={strings.faqSectionTitle}
>
{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
heading={strings.ifrcRelatedLinksTitle}
>
{ifrcResources.map((externalLink) => (
<Link
className={styles.resourceLink}
key={externalLink.id}
href={externalLink.url}
actions={<ExternalLinkLineIcon />}
external
>
{externalLink.title}
</Link>
))}
</Container>
<Container
heading={strings.ifrcRelatedExternalLinksTitle}
>

{externalResources.map((externalLink) => (
<Link
className={styles.resourceLink}
key={externalLink.id}
href={externalLink.url}
actions={<ExternalLinkLineIcon />}
external
>
{externalLink.title}
</Link>
))}
</Container>
</Page>
);
Expand Down
29 changes: 12 additions & 17 deletions src/views/Resources/styles.module.css
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
.resources {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add flex gap

.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-lg);

.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);
}
}