Skip to content

Commit 3174548

Browse files
committed
Hide meteoswiss option for production
1 parent 34a4fe8 commit 3174548

File tree

8 files changed

+195
-180
lines changed

8 files changed

+195
-180
lines changed

src/components/RadioInput/Radio/index.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ import useBasicLayout from '#hooks/useBasicLayout';
1010
import styles from './styles.module.css';
1111

1212
export interface Props<N, IN> {
13-
className?: string;
14-
inputName?: IN;
15-
label?: React.ReactNode;
16-
description?: React.ReactNode;
17-
name: N;
18-
onClick: (name: N) => void;
19-
value: boolean;
20-
disabled?: boolean;
21-
readOnly?: boolean;
13+
className?: string;
14+
inputName?: IN;
15+
label?: React.ReactNode;
16+
description?: React.ReactNode;
17+
name: N;
18+
onClick: (name: N) => void;
19+
value: boolean;
20+
disabled?: boolean;
21+
readOnly?: boolean;
22+
actions?: React.ReactNode;
2223
}
2324

2425
function Radio<N, IN>(props: Props<N, IN>) {
@@ -32,6 +33,7 @@ function Radio<N, IN>(props: Props<N, IN>) {
3233
onClick,
3334
disabled,
3435
readOnly,
36+
actions,
3537
} = props;
3638

3739
const handleClick = React.useCallback(() => {
@@ -49,6 +51,7 @@ function Radio<N, IN>(props: Props<N, IN>) {
4951
) : (
5052
<CheckboxBlankCircleLineIcon className={styles.icon} />
5153
),
54+
actions,
5255
childrenContainerClassName: styles.content,
5356
children: (
5457
<>

src/components/WikiLink/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { WikiHelpSectionLineIcon } from '@ifrc-go/icons';
2+
import { _cs } from '@togglecorp/fujs';
23

34
import Link from '#components/Link';
45
import type { Props as LinkProps } from '#components/Link';
@@ -7,7 +8,6 @@ import useTranslation from '#hooks/useTranslation';
78

89
import i18n from './i18n.json';
910
import styles from './styles.module.css';
10-
import { _cs } from '@togglecorp/fujs';
1111

1212
type Props<OMISSION extends string = never> = Omit<LinkProps, 'to' | OMISSION> & {
1313
icons?: React.ReactNode;

src/components/domain/NationalSocietySelectInput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import { isDefined } from '@togglecorp/fujs';
2+
13
import type { Props as SelectInputProps } from '#components/SelectInput';
24
import SelectInput from '#components/SelectInput';
35
import { numericIdSelector } from '#utils/selectors';
46
import useNationalSociety, { NationalSociety } from '#hooks/domain/useNationalSociety';
5-
import { isDefined } from '@togglecorp/fujs';
67

78
function countrySocietyNameSelector(country: NationalSociety) {
89
return country.society_name;
@@ -35,7 +36,6 @@ function NationalSocietySelectInput<const NAME>(props: Props<NAME>) {
3536
...otherProps
3637
} = props;
3738

38-
console.warn('regions', regions, countries);
3939
const nationalSocieties = useNationalSociety();
4040
let options: NationalSociety[] = nationalSocieties;
4141

src/components/domain/RiskImminentEventMap/i18n.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
"namespace": "common",
33
"strings": {
44
"riskImminentEventsMap": "Risk Imminent Events Map",
5-
"backToEventsLabel": "Back to events",
6-
"imminentEventsFlood": "Flood",
7-
"imminentEventsStorm": "Storm",
8-
"imminentEventsEarthquake": "Earthquake",
9-
"imminentEventsDrought": "Drought",
10-
"imminentEventsWildfire": "Wildfire"
5+
"backToEventsLabel": "Back to events"
116
}
127
}

src/components/domain/RiskImminentEventMap/index.tsx

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,7 @@ import {
1111
MapImage,
1212
MapBounds,
1313
} from '@togglecorp/re-map';
14-
import {
15-
CycloneIcon,
16-
DroughtIcon,
17-
EarthquakeIcon,
18-
FloodIcon,
19-
ForestFireIcon,
20-
ChevronLeftLineIcon,
21-
} from '@ifrc-go/icons';
14+
import { ChevronLeftLineIcon } from '@ifrc-go/icons';
2215
import getBbox from '@turf/bbox';
2316
import getBuffer from '@turf/buffer';
2417

@@ -34,7 +27,6 @@ import {
3427
} from '#utils/constants';
3528
import MapContainerWithDisclaimer from '#components/MapContainerWithDisclaimer';
3629
import BaseMap from '#components/domain/BaseMap';
37-
import { hazardTypeToColorMap } from '#utils/domain/risk';
3830
import useTranslation from '#hooks/useTranslation';
3931

4032
import {
@@ -246,75 +238,12 @@ function RiskImminentEventMap<
246238
[allIconsLoaded],
247239
);
248240

249-
const riskHazards: Array<{
250-
key: HazardType,
251-
label: string,
252-
icon: React.ReactNode,
253-
}> = useMemo(
254-
() => [
255-
{
256-
key: 'FL',
257-
label: strings.imminentEventsFlood,
258-
icon: <FloodIcon className={styles.icon} />,
259-
},
260-
{
261-
key: 'TC',
262-
label: strings.imminentEventsStorm,
263-
icon: <CycloneIcon className={styles.icon} />,
264-
},
265-
{
266-
key: 'EQ',
267-
label: strings.imminentEventsEarthquake,
268-
icon: <EarthquakeIcon className={styles.icon} />,
269-
},
270-
{
271-
key: 'DR',
272-
label: strings.imminentEventsDrought,
273-
icon: <DroughtIcon className={styles.icon} />,
274-
},
275-
{
276-
key: 'WF',
277-
label: strings.imminentEventsWildfire,
278-
icon: <ForestFireIcon className={styles.icon} />,
279-
},
280-
],
281-
[
282-
strings.imminentEventsFlood,
283-
strings.imminentEventsStorm,
284-
strings.imminentEventsEarthquake,
285-
strings.imminentEventsDrought,
286-
strings.imminentEventsWildfire,
287-
],
288-
);
289-
290241
return (
291242
<div className={styles.riskImminentEventMap}>
292243
<BaseMap>
293244
<MapContainerWithDisclaimer
294245
title={strings.riskImminentEventsMap}
295246
className={styles.mapContainer}
296-
footer={(
297-
<div className={styles.legend}>
298-
{riskHazards.map((hazard) => (
299-
<div
300-
key={hazard.key}
301-
className={styles.legendItem}
302-
>
303-
<div
304-
className={styles.iconContainer}
305-
style={{
306-
backgroundColor: hazardTypeToColorMap[hazard.key],
307-
}}
308-
>
309-
{hazard.icon}
310-
</div>
311-
<div className={styles.label}>
312-
{hazard.label}
313-
</div>
314-
</div>
315-
))}
316-
</div>
317-
)}
318247
/>
319248
{hazardKeys.map((key) => {
320249
const url = hazardKeyToIconmap[key];

src/components/domain/RiskImminentEvents/i18n.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
"gdacsDescription": "Click {here} for more information about the model and its inputs.",
1717
"meteoSwissTitle": "Source: MeteoSwiss",
1818
"meteoSwissDescriptionOne": "This impact estimates are produced by MeteoSwiss HydroMet Impact Outlook. © 2022 MeteoSwiss. All Rights reserved.",
19-
"meteoSwissDescriptionTwo": "Disclaimer: HydroMet Impact Outlook is in a pilot phase. MeteoSwiss makes no warranty with respect to the correctness or completeness of this information. This information does not replace the advice and guidance provided by the official meteorological and hydrological services for these regions. For further information click {here}."
19+
"meteoSwissDescriptionTwo": "Disclaimer: HydroMet Impact Outlook is in a pilot phase. MeteoSwiss makes no warranty with respect to the correctness or completeness of this information. This information does not replace the advice and guidance provided by the official meteorological and hydrological services for these regions. For further information click {here}.",
20+
"imminentEventsFlood": "Flood",
21+
"imminentEventsStorm": "Storm",
22+
"imminentEventsEarthquake": "Earthquake",
23+
"imminentEventsDrought": "Drought",
24+
"imminentEventsWildfire": "Wildfire"
2025
}
2126
}

0 commit comments

Comments
 (0)