Skip to content

Commit da2b758

Browse files
authored
Merge pull request #1198 from IFRCGo/fix/local-unit-stylings
Update local unit stylings
2 parents b1962a1 + 2f47b7c commit da2b758

File tree

75 files changed

+3726
-4961
lines changed

Some content is hidden

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

75 files changed

+3726
-4961
lines changed

.changeset/breezy-peaches-talk.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@ifrc-go/ui": patch
3+
---
4+
5+
- Add and export Legend component
6+
- Add FilterBar component
7+
- Update RawList to extend Key prop from react
8+
- Add a pageWidth option for Modal size
9+
- Update Container to use FilterBar
10+
- Remove withGridViewInFiterProp from Container, make it the default behavior
11+
- Add filterActions props in Container

.changeset/polite-houses-suffer.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"go-web-app": patch
3+
---
4+
5+
- Update Local Unit map, table and form to match the updated design
6+
- Add delete button in Local units table and form
7+
- Use filter prop in container and remove manual stylings
8+
- Update size of WikiLink to match height of other action items
9+
- Add error boundary to BaseMap component

app/src/components/WikiLink/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function WikiLink<N extends string>(props: Props<N>) {
3636
// eslint-disable-next-line react/jsx-props-no-spreading
3737
{...otherProps}
3838
>
39-
<WikiHelpSectionLineIcon />
39+
<WikiHelpSectionLineIcon className={styles.icon} />
4040
</Link>
4141
);
4242
}
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
.wiki-link {
2-
font-size: var(--go-ui-font-size-3xl);
2+
padding: 0;
3+
font-size: var(--go-ui-font-size-2xl);
4+
5+
.icon {
6+
transform: scale(1.4);
7+
}
38
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ function ActiveOperationMap(props: Props) {
382382
heading={!presentationMode && heading}
383383
withHeaderBorder={!presentationMode}
384384
childrenContainerClassName={styles.content}
385-
withGridViewInFilter
386385
filters={!presentationMode && (
387386
<>
388387
<DateInput

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@ function AppealsTable(props: Props) {
254254
<Container
255255
className={_cs(styles.appealsTable, className)}
256256
childrenContainerClassName={styles.content}
257-
withGridViewInFilter
258257
heading={heading}
259258
withHeaderBorder={isDefined(heading)}
260259
filters={(

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
useMemo,
44
} from 'react';
55
import { LanguageContext } from '@ifrc-go/ui/contexts';
6+
import { ErrorBoundary } from '@sentry/react';
67
import {
78
isDefined,
89
isFalsyString,
@@ -22,6 +23,8 @@ import {
2223
defaultNavControlPosition,
2324
} from '#utils/map';
2425

26+
import styles from './styles.module.css';
27+
2528
type MapProps = Parameters<typeof Map>[0];
2629

2730
type overrides = 'mapStyle' | 'mapOptions' | 'navControlShown' | 'navControlPosition' | 'navControlOptions' | 'scaleControlShown';
@@ -175,4 +178,21 @@ function BaseMap(props: Props) {
175178
);
176179
}
177180

178-
export default BaseMap;
181+
function BaseMapWithErrorBoundary(props: Props) {
182+
return (
183+
<ErrorBoundary
184+
fallback={(
185+
<div className={styles.mapError}>
186+
Failed to load map!
187+
</div>
188+
)}
189+
>
190+
<BaseMap
191+
// eslint-disable-next-line react/jsx-props-no-spreading
192+
{...props}
193+
/>
194+
</ErrorBoundary>
195+
);
196+
}
197+
198+
export default BaseMapWithErrorBoundary;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.map-error {
2+
display: flex;
3+
align-items: center;
4+
justify-content: center;
5+
background-color: var(--go-ui-color-background);
6+
min-height: 20rem;
7+
color: var(--go-ui-color-red);
8+
font-size: var(--go-ui-font-size-lg);
9+
}

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ function BaseMapPointInput<NAME extends string>(props: Props<NAME>) {
103103
type: 'Point',
104104
coordinates: [value.lng, value.lat],
105105
},
106-
properties: {},
106+
properties: {
107+
radius: 10,
108+
},
107109
};
108110
},
109111
[value],
@@ -150,7 +152,7 @@ function BaseMapPointInput<NAME extends string>(props: Props<NAME>) {
150152
visibility: 'visible',
151153
},
152154
paint: {
153-
'circle-radius': 10,
155+
'circle-radius': ['get', 'radius'],
154156
'circle-color': COLOR_PRIMARY_RED,
155157
},
156158
}),

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ function HistoricalDataChart(props: Props) {
193193
className={styles.historicalDataChart}
194194
heading={strings.historicalChartHeading}
195195
withHeaderBorder
196-
filtersContainerClassName={styles.filters}
197196
filters={(
198197
<SelectInput
199198
name={undefined}

0 commit comments

Comments
 (0)