Skip to content

Commit 3091dbd

Browse files
committed
feat(prepredness): added all emergency table and fix pr review req changes
1 parent 9c37b34 commit 3091dbd

50 files changed

Lines changed: 1230 additions & 258 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/pull_request_template.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@
2121

2222
## This PR includes
2323

24-
- [ ] Translation
24+
- [ ] Translation
25+
- [ ] Permission

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ COPY . /code/
2020

2121
# # Build variables (Requires backend pulled)
2222
ENV APP_TITLE=ercs-eoc
23-
ENV APP_ENVIRONMENT=production
23+
ENV APP_ENVIRONMENT=development
2424
ENV APP_GRAPHQL_ENDPOINT=http://localhost:8000
2525
ENV APP_GRAPHQL_CODEGEN_ENDPOINT=./backend/schema.graphql
2626
ENV APP_MAPBOX_TOKEN=APP_MAPBOX_TOKEN_PLACEHOLDER

app/Root/config/routes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const galleries: RouteConfig = {
9595
visibility: 'is-authenticated',
9696
};
9797

98+
// TODO: add terms and conditions and cookie policy page
9899
const termsAndConditions: RouteConfig = {
99100
index: true,
100101
path: '/terms-and-conditions',

app/Root/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
import PreloadMessage from '#components/PreloadMessage';
1919
import {
2020
api,
21+
appTitle,
2122
environment,
2223
} from '#config';
2324
import UserContext, { type UserContextInterface } from '#contexts/UserContext';
@@ -76,6 +77,8 @@ function Root() {
7677
<Suspense
7778
fallback={(
7879
<PreloadMessage>
80+
{appTitle}
81+
{' '}
7982
loading...
8083
</PreloadMessage>
8184
)}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { use } from 'react';
2+
import {
3+
SelectInput,
4+
type SelectInputProps,
5+
} from '@ifrc-go/ui';
6+
7+
import GoContext, { type DisasterTypes } from '#contexts/GoContext';
8+
9+
export type DisasterTypeItem = NonNullable<DisasterTypes['results']>[number];
10+
11+
function keySelector(type: DisasterTypeItem) {
12+
return type.id;
13+
}
14+
function labelSelector(type: DisasterTypeItem) {
15+
return type.name ?? '?';
16+
}
17+
18+
type Props<NAME> = SelectInputProps<
19+
number,
20+
NAME,
21+
DisasterTypeItem,
22+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
23+
any,
24+
'value' | 'name' | 'options' | 'keySelector' | 'labelSelector'
25+
> & {
26+
className?: string;
27+
name: NAME;
28+
onChange: (
29+
newValue: number | undefined,
30+
name: NAME,
31+
option: DisasterTypeItem | undefined,
32+
) => void;
33+
value: number | undefined | null;
34+
optionsFilter?: (item: DisasterTypeItem) => boolean;
35+
readOnly?: boolean;
36+
}
37+
38+
function DisasterTypeSelectInput<const NAME>(props: Props<NAME>) {
39+
const {
40+
className,
41+
name,
42+
onChange,
43+
value,
44+
optionsFilter,
45+
...otherProps
46+
} = props;
47+
48+
const { disasterTypes } = use(GoContext);
49+
50+
const options = optionsFilter
51+
? disasterTypes?.results.filter(optionsFilter)
52+
: disasterTypes?.results;
53+
54+
return (
55+
<SelectInput
56+
// eslint-disable-next-line react/jsx-props-no-spreading
57+
{...otherProps}
58+
className={className}
59+
name={name}
60+
options={options}
61+
keySelector={keySelector}
62+
labelSelector={labelSelector}
63+
value={value}
64+
onChange={onChange}
65+
/>
66+
);
67+
}
68+
69+
export default DisasterTypeSelectInput;
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { DownloadTwoLineIcon } from '@ifrc-go/icons';
2+
import {
3+
Button,
4+
NumberOutput,
5+
} from '@ifrc-go/ui';
6+
import { resolveToComponent } from '@ifrc-go/ui/utils';
7+
8+
interface Props {
9+
onClick: () => void;
10+
disabled?: boolean;
11+
progress?: number;
12+
pendingExport: boolean;
13+
totalCount: number | undefined;
14+
}
15+
16+
function ExportButton(props: Props) {
17+
const {
18+
onClick,
19+
disabled,
20+
progress,
21+
pendingExport,
22+
totalCount = 0,
23+
} = props;
24+
const getExportLabel = () => {
25+
if (!pendingExport) return 'Export';
26+
27+
if (progress != null) {
28+
return resolveToComponent('Downloading... ({progress}%)', {
29+
progress: (
30+
<NumberOutput
31+
value={progress * 100}
32+
maximumFractionDigits={0}
33+
/>
34+
),
35+
});
36+
}
37+
38+
return 'Downloading...';
39+
};
40+
41+
return (
42+
<Button
43+
name={undefined}
44+
onClick={onClick}
45+
before={<DownloadTwoLineIcon />}
46+
disabled={totalCount < 1 || pendingExport || disabled}
47+
>
48+
{getExportLabel()}
49+
</Button>
50+
);
51+
}
52+
53+
export default ExportButton;

app/components/Footer/index.tsx

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import {
22
SocialFacebookIcon,
3+
SocialInstagramIcon,
4+
SocialLinkedinIcon,
35
SocialMediumIcon,
6+
SocialTwitterIcon,
47
SocialYoutubeIcon,
58
} from '@ifrc-go/icons';
69
import {
@@ -51,7 +54,7 @@ function GlobalFooter(props: Props) {
5154
needs with the right response.
5255
</div>
5356
<div className={styles.copyright}>
54-
© IFRC
57+
© ERCS EOC
5558
{' '}
5659
{year}
5760
</div>
@@ -126,9 +129,7 @@ function GlobalFooter(props: Props) {
126129
Dataset
127130
</Link>
128131
<Link
129-
href="https://github.com/ifrcgo/go-web-app"
130-
external
131-
colorVariant="text-on-dark"
132+
to="projectMapping"
132133
>
133134
Project Mapping
134135
</Link>
@@ -150,41 +151,70 @@ function GlobalFooter(props: Props) {
150151
withSpacingOpticalCorrection
151152
>
152153
<Link
153-
href="mailto:im@ifrc.org"
154+
href="mailto:ercsinfo@redcrosseth.org"
154155
colorVariant="primary"
155156
styleVariant="filled"
156157
external
157158
withLinkIcon
158159
textSize="sm"
159160
spacing="xs"
160161
>
161-
im@ifrc.org
162+
ercsinfo@redcrosseth.org
162163
</Link>
163164
<ListView spacing="sm">
164165
<Link
165166
className={styles.socialIcon}
166-
href="https://ifrcgoproject.medium.com"
167+
href="https://x.com/ethioredcross"
167168
external
168169
colorVariant="text-on-dark"
169170
>
170-
<SocialMediumIcon />
171+
{/* TODO: change twitter icon in ifrc go icon to X */}
172+
<SocialTwitterIcon />
171173
</Link>
172174
<Link
173175
className={styles.socialIcon}
174-
href="https://www.facebook.com/IFRC"
176+
href="https://www.facebook.com/EthiopianRedCross"
175177
external
176178
colorVariant="text-on-dark"
177179
>
178180
<SocialFacebookIcon />
179181
</Link>
180182
<Link
181183
className={styles.socialIcon}
182-
href="https://www.youtube.com/watch?v=dwPsQzla9A4"
184+
href="https://www.flickr.com/people/137615657@N05/"
185+
external
186+
colorVariant="text-on-dark"
187+
>
188+
{/* TODO: add flickr icon in ifrc go icon */}
189+
<SocialMediumIcon />
190+
</Link>
191+
<Link
192+
className={styles.socialIcon}
193+
href="https://www.linkedin.com/company/ethiopian-red-cross-society/"
194+
external
195+
colorVariant="text-on-dark"
196+
>
197+
<SocialLinkedinIcon />
198+
</Link>
199+
200+
<Link
201+
className={styles.socialIcon}
202+
href="https://www.youtube.com/channel/UCpGN4FZcstRlR5PvhNWzCFw"
183203
external
184204
colorVariant="text-on-dark"
185205
>
186206
<SocialYoutubeIcon />
187207
</Link>
208+
209+
<Link
210+
className={styles.socialIcon}
211+
href="https://www.instagram.com/ercs1935?igsh=cjJtbGhtcnFkNnMw"
212+
external
213+
colorVariant="text-on-dark"
214+
>
215+
<SocialInstagramIcon />
216+
</Link>
217+
188218
</ListView>
189219
</ListView>
190220
</Container>

app/components/Link/index.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ function Link(props: Props) {
5454
external,
5555
href,
5656
withEllipsizedContent,
57-
spacingOffset,
5857
withFullWidth,
5958
disabled,
6059
textSize,
6160
withLinkIcon,
6261
withUnderline,
62+
spacingOffset = styleVariant === 'action' ? -5 : -3,
6363
...otherProps
6464
} = props;
6565

@@ -73,7 +73,10 @@ function Link(props: Props) {
7373
&& styles.withUnderline,
7474
)}
7575
before={before}
76-
childrenContainerClassName={childrenContainerClassName}
76+
childrenContainerClassName={_cs(
77+
childrenContainerClassName,
78+
styles.childrenContainer,
79+
)}
7780
spacing={spacing}
7881
colorVariant={colorVariant}
7982
styleVariant={styleVariant}

app/components/Link/styles.module.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@
1010
.link-icon {
1111
font-size: var(--go-ui-height-icon-multiplier);
1212
}
13+
14+
.children-container {
15+
display: inline-flex;
16+
}
1317
}

app/components/Navbar/styles.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
background-color: var(--go-ui-color-white);
44

55
.top {
6-
border-bottom: var(--go-ui-width-separator-thin) solid var(--go-ui-color-primary-red);
6+
border-bottom: var(--go-ui-width-separator-md) solid var(--go-ui-color-primary-red);
77

88
.top-content {
99
padding: var(--go-ui-spacing-sm) var(--go-ui-spacing-lg);

0 commit comments

Comments
 (0)