Skip to content

Commit

Permalink
Merge pull request #29 from IFRCGo/feature/about-page
Browse files Browse the repository at this point in the history
Add about page
  • Loading branch information
barshathakuri authored Apr 23, 2024
2 parents 22eb370 + 6faebab commit c275bde
Show file tree
Hide file tree
Showing 8 changed files with 177 additions and 7 deletions.
8 changes: 8 additions & 0 deletions src/App/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ const preferences = myWrapRoute({
componentProps: {},
parent: root,
});
const about = myWrapRoute({
title: 'About',
path: 'about',
component: () => import('#views/About'),
componentProps: {},
parent: root,
});

const resource = myWrapRoute({
title: 'Resource',
Expand Down Expand Up @@ -82,6 +89,7 @@ export const wrappedRoutes = {
alertDetails,
resource,
viewAllSource,
about,
};

export const unwrappedRoutes = unwrapRoute(Object.values(wrappedRoutes));
Expand Down
3 changes: 1 addition & 2 deletions src/components/Navbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ function Navbar(props: Props) {
variant="tertiary"
>
<LangaugeDropdown />
{/* // FIXME: Add About route */}
<Link
className={styles.actionItem}
to="/"
to={routes.about.absolutePath}
>
{strings.appAbout}
</Link>
Expand Down
6 changes: 1 addition & 5 deletions src/components/Page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,7 @@ function Page(props: Props) {
)}
ref={elementRef}
>
{beforeHeaderContent && (
<PageContainer>
{beforeHeaderContent}
</PageContainer>
)}
{beforeHeaderContent && beforeHeaderContent}
{isNotDefined(blockingContent) && showPageContainer && (
<PageHeader
className={_cs(
Expand Down
Binary file added src/views/About/about.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/views/About/homepage_bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/views/About/i18n.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"namespace": "about",
"strings": {
"aboutTheGoalTitile": "The Goal",
"aboutGoalDescription":"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.",
"aboutimage":"",
"aboutTheProblemTitle":"The Problem",
"aboutTheProblemDescription":"Every year, millions of people are killed, injured, displaced or made poor by natural hazards whose impacts could have been prevented or reduced. Too much of this loss is due to ineffective public warning: emergency alerts that are not timely enough, difficult to understand or fail to reach everyone at risk.",
"aboutProblemFactorsIncluding":"This failure to reach people is due to a number of factors including:",
"aboutTheProblemHazardInformation":"Hazard information that is not communicated effectively or in a consistent format;",
"aboutTheProblemOverlyComplicated":"Overly complicated, data-heavy messages that are not contextually appropriate nor understandable by the general public;",
"aboutTheProblemActionableGuidance":"A lack of actionable guidance that people can understand and trust on how to stay safe;",
"aboutTheProblemLimitedBroadcasting":"Limited broadcasting of hazard alerts across too few communication channels.",
"aboutTheSolutionTitle":"The Solution",
"aboutTheSolutionDescription":"The IFRC Alert Hub aims to address this situation by leveraging modern communications technology and proven international standards to increase the delivery of reliable, actionable emergency alerts and encourage anticipatory action by people in harm’s way.",
"aboutSolutionSteps":"This will be done by:",
"aboutSolutionStep1":"increasing access for the media and online networks to official government alerts published using the Common Alerting Protocol (CAP), a digital format for exchanging emergency alerts, which allows a consistent alert message to be disseminated simultaneously over multiple communications pathways",
"aboutSolutionStep2":"facilitate the pairing of the CAP hazard alerts with locally contextualized and actionable public awareness and public education messages that have been developed and agreed to by national governments and emergency management organizations.",
"aboutDisclaimerTitle":"Disclaimer",
"aboutDisclaimerDescription":"The IFRC Alert Hub publishes only official alerts issued by recognised government alerting agencies. Alerts are not issued or published by the IFRC or its member Red Cross and Red Crescent National Societies. The IFRC takes no responsibility for the information contained in the alerts, which is solely the responsibility of the issuing agency. The IFRC makes every effort to identify broken government alert feeds and to highlight this information for users of the Alert Hub. However, the IFRC does not maintain 24/7 monitoring of the status of the government feeds and it is the responsibility of Alert Hub users to identify redundant sources of hazard alert information."
}
}
103 changes: 103 additions & 0 deletions src/views/About/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import {
Container,
Header,
PageContainer,
} from '@ifrc-go/ui';
import { useTranslation } from '@ifrc-go/ui/hooks';

import Page from '#components/Page';

import aboutIcon from './about.png';
import backgroundImage from './homepage_bg.png';

import i18n from './i18n.json';
import styles from './styles.module.css';

// eslint-disable-next-line import/prefer-default-export
export function Component() {
const strings = useTranslation(i18n);

return (
<Page
title="AlertHub - About"
className={styles.about}
beforeHeaderContent={(
<div className={styles.headerContainer}>
<img
className={styles.backgroundImage}
src={backgroundImage}
alt=""
/>
<PageContainer
className={styles.headerContentSection}
contentClassName={styles.content}
>
<Header
className={styles.header}
heading={strings.aboutTheGoalTitile}
headingLevel={1}
childrenContainerClassName={styles.description}
spacing="loose"
>
{strings.aboutGoalDescription}
</Header>
<img
className={styles.aboutIcon}
src={aboutIcon}
alt=""
/>
</PageContainer>
</div>
)}
mainSectionClassName={styles.pageContent}
>
<Container
heading={strings.aboutTheProblemTitle}
withHeaderBorder
contentViewType="vertical"
>
<div>
{strings.aboutTheProblemDescription}
</div>
<div>
{strings.aboutProblemFactorsIncluding}
</div>
<ul>
<li>
{strings.aboutTheProblemHazardInformation}
</li>
<li>
{strings.aboutTheProblemOverlyComplicated}
</li>
<li>
{strings.aboutTheProblemActionableGuidance}
</li>
<li>
{strings.aboutTheProblemLimitedBroadcasting}
</li>
</ul>
</Container>
<Container
heading={strings.aboutTheSolutionTitle}
withHeaderBorder
contentViewType="vertical"
>
<div>{strings.aboutTheSolutionDescription}</div>
<div>{strings.aboutSolutionSteps}</div>
<ol>
<li>{strings.aboutSolutionStep1}</li>
<li>{strings.aboutSolutionStep2}</li>
</ol>
</Container>
<Container
heading={strings.aboutDisclaimerTitle}
contentViewType="vertical"
withHeaderBorder
>
<div>{strings.aboutDisclaimerDescription}</div>
</Container>
</Page>
);
}

Component.displayName = 'About';
42 changes: 42 additions & 0 deletions src/views/About/styles.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.about {
.header-container {
position: relative;
background-image: url(src/assets/homepage_bg.png);
background-repeat: no-repeat;

.background-image {
position: absolute;
z-index: -1;
width: 100%;
height: 100%;
}

.header-content-section {
height: 100%;
min-height: 30rem;

.content {
display: flex;
align-items: center;

.header {
color: var(--go-ui-color-white);

.about-icon {
height: 20rem;
}

.description {
font-size: var(--go-ui-font-size-xl);
}
}
}
}
}

.page-content {
display: flex;
flex-direction: column;
gap: var(--go-ui-spacing-2xl);
}
}

0 comments on commit c275bde

Please sign in to comment.