Skip to content

Commit 58d60bb

Browse files
committed
Update source for the map style in local unit map
1 parent 2b357e3 commit 58d60bb

File tree

7 files changed

+53
-14
lines changed

7 files changed

+53
-14
lines changed

app/src/components/Link/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ function Link(props: Props) {
285285
ellipsize && styles.ellipsized,
286286
className,
287287
)}
288+
title={(ellipsize && typeof childrenFromProps === 'string')
289+
? childrenFromProps : undefined}
288290
>
289291
{children}
290292
</div>

app/src/components/Link/styles.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
width: fit-content;
88

99
&.ellipsized {
10+
width: 100%;
1011
overflow: auto;
1112
}
1213

app/src/components/domain/ActiveCountryBaseMapLayer/index.tsx

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ import {
1212
COLOR_WHITE,
1313
} from '#utils/constants';
1414

15+
const hiddenFillLayerOptions: Omit<FillLayer, 'id'> = {
16+
type: 'fill',
17+
layout: {
18+
visibility: 'none',
19+
},
20+
};
21+
1522
interface Props {
1623
activeCountryIso3: string | undefined | null;
1724
}
@@ -25,10 +32,18 @@ function ActiveCountryBaseMapLayer(props: Props) {
2532
layout: { visibility: 'visible' },
2633
paint: {
2734
'fill-color': [
28-
'match',
29-
['get', 'iso3'],
30-
activeCountryIso3,
31-
COLOR_ACTIVE_REGION,
35+
'interpolate',
36+
['linear'],
37+
['zoom'],
38+
2,
39+
[
40+
'match',
41+
['get', 'iso3'],
42+
activeCountryIso3,
43+
COLOR_ACTIVE_REGION,
44+
COLOR_LIGHT_GREY,
45+
],
46+
10,
3247
COLOR_LIGHT_GREY,
3348
],
3449
},
@@ -80,6 +95,10 @@ function ActiveCountryBaseMapLayer(props: Props) {
8095
layerKey="admin-0"
8196
layerOptions={adminZeroHighlightLayerOptions}
8297
/>
98+
<MapLayer
99+
layerKey="admin-0-highlight"
100+
layerOptions={hiddenFillLayerOptions}
101+
/>
83102
<MapLayer
84103
layerKey="admin-1-boundary"
85104
layerOptions={adminOneBoundaryLayerOptions}

app/src/components/domain/HighlightedOperations/OperationCard/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ function OperationCard(props: Props) {
119119
<Container
120120
className={_cs(styles.operationCard, className)}
121121
// heading={name}
122+
headingClassName={styles.heading}
123+
headingContainerClassName={styles.headingContainer}
122124
heading={(
123125
<Link
124126
to="emergenciesLayout"

app/src/components/domain/HighlightedOperations/OperationCard/styles.module.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
.operation-card {
22
border-radius: var(--go-ui-border-radius-lg);
33
box-shadow: var(--go-ui-box-shadow-md);
4+
width: 100%;
5+
overflow: auto;
6+
7+
.heading-container {
8+
width: 100%;
9+
overflow: auto;
10+
}
11+
12+
.heading {
13+
width: 100%;
14+
overflow: auto;
15+
}
416

517
.severity-indicator {
618
font-size: var(--go-ui-font-size-xl);

app/src/views/CountryNsOverviewContextAndStructure/NationalSocietyLocalUnits/LocalUnitsMap/index.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { useTranslation } from '@ifrc-go/ui/hooks';
1414
import { sumSafe } from '@ifrc-go/ui/utils';
1515
import {
1616
isDefined,
17+
isNotDefined,
1718
isTruthyString,
1819
} from '@togglecorp/fujs';
1920
import {
@@ -151,7 +152,7 @@ function LocalUnitsMap() {
151152
response: publicLocalUnitsResponse,
152153
pending: publicLocalUnitsPending,
153154
} = useRequest({
154-
skip: requestType !== PUBLIC,
155+
skip: requestType !== PUBLIC || isNotDefined(countryResponse),
155156
url: '/api/v2/public-local-units/',
156157
query: urlQuery,
157158
});
@@ -160,7 +161,7 @@ function LocalUnitsMap() {
160161
response: localUnitsResponse,
161162
pending: localUnitsPending,
162163
} = useRequest({
163-
skip: requestType !== AUTHENTICATED,
164+
skip: requestType !== AUTHENTICATED || isNotDefined(countryResponse),
164165
url: '/api/v2/local-units/',
165166
query: urlQuery,
166167
});
@@ -235,7 +236,7 @@ function LocalUnitsMap() {
235236
pending: publicLocalUnitDetailPending,
236237
error: publicLocalUnitDetailError,
237238
} = useRequest({
238-
skip: requestType !== PUBLIC,
239+
skip: requestType !== PUBLIC || isNotDefined(clickedPointProperties),
239240
url: '/api/v2/public-local-units/{id}/',
240241
pathVariables: isDefined(clickedPointProperties) ? ({
241242
id: clickedPointProperties.localUnitId,
@@ -247,24 +248,24 @@ function LocalUnitsMap() {
247248
pending: superLocalUnitDetailPending,
248249
error: superLocalUnitDetailError,
249250
} = useRequest({
250-
skip: requestType !== AUTHENTICATED,
251+
skip: requestType !== AUTHENTICATED || isNotDefined(clickedPointProperties),
251252
url: '/api/v2/local-units/{id}/',
252253
pathVariables: isDefined(clickedPointProperties) ? ({
253254
id: clickedPointProperties.localUnitId,
254255
}) : undefined,
255256
});
256257

257258
const localUnitDetail = requestType !== AUTHENTICATED
258-
? superLocalUnitDetailResponse
259-
: publicLocalUnitDetailResponse;
259+
? publicLocalUnitDetailResponse
260+
: superLocalUnitDetailResponse;
260261

261262
const localUnitDetailPending = requestType !== AUTHENTICATED
262-
? superLocalUnitDetailPending
263-
: publicLocalUnitDetailPending;
263+
? publicLocalUnitDetailPending
264+
: superLocalUnitDetailPending;
264265

265266
const localUnitDetailError = requestType !== AUTHENTICATED
266-
? superLocalUnitDetailError
267-
: publicLocalUnitDetailError;
267+
? publicLocalUnitDetailError
268+
: superLocalUnitDetailError;
268269

269270
const localUnitsGeoJson = react.useMemo<GeoJSON.FeatureCollection<GeoJSON.Geometry>>(
270271
() => ({
@@ -352,6 +353,7 @@ function LocalUnitsMap() {
352353
>
353354
<div className={styles.mapContainerWithContactDetails}>
354355
<BaseMap
356+
mapStyle="mapbox://styles/go-ifrc/clvvgugzh00x501pc1n00b8cz"
355357
withoutLabel
356358
baseLayers={(
357359
<ActiveCountryBaseMapLayer

packages/ui/src/components/LegendItem/styles.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
align-items: center;
1717
justify-content: center;
1818
border-radius: 50%;
19+
padding: var(--go-ui-spacing-2xs);
1920
width: 1.2rem;
2021
height: 1.2rem;
2122

0 commit comments

Comments
 (0)