Skip to content

Commit c1f350e

Browse files
committed
fix: remove unused usePerComponent hook
1 parent 7b4a47a commit c1f350e

File tree

4 files changed

+15
-71
lines changed

4 files changed

+15
-71
lines changed

app/src/hooks/domain/usePerComponent.ts

Lines changed: 0 additions & 56 deletions
This file was deleted.

app/src/views/OperationalLearning/Filters/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,17 @@ import { type EntriesAsList } from '@togglecorp/toggle-form';
1717

1818
import CountryMultiSelectInput, { type CountryOption } from '#components/domain/CountryMultiSelectInput';
1919
import RegionSelectInput, { type RegionOption } from '#components/domain/RegionSelectInput';
20+
import { type PerComponents } from '#contexts/domain';
2021
import { type components } from '#generated/types';
2122
import { type DisasterType } from '#hooks/domain/useDisasterType';
22-
import { type PerComponent } from '#hooks/domain/usePerComponent';
2323
import { type SecondarySector } from '#hooks/domain/useSecondarySector';
2424
import { getFormattedComponentName } from '#utils/domain/per';
2525
import { type GoApiResponse } from '#utils/restRequest';
2626

2727
import i18n from './i18n.json';
2828

29+
export type PerComponent = NonNullable<PerComponents['results']>[number];
30+
2931
type OpsLearningOrganizationType = NonNullable<GoApiResponse<'/api/v2/ops-learning/organization-type/'>['results']>[number];
3032
export type PerLearningType = components<'read'>['schemas']['PerLearningTypeEnum'];
3133

app/src/views/OperationalLearning/Stats/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ function Stats(props: Props) {
182182
return (
183183
<div className={styles.stats}>
184184
{learningStatsPending && <BlockLoading />}
185-
<div className={styles.keyFigureList}>
185+
<Container
186+
contentViewType="grid"
187+
numPreferredGridContentColumns={4}
188+
spacing="compact"
189+
>
186190
<KeyFigure
187191
className={styles.keyFigure}
188192
value={learningStatsResponse?.operations_included}
@@ -207,7 +211,7 @@ function Stats(props: Props) {
207211
label={strings.sectorsCovered}
208212
labelClassName={styles.keyFigureDescription}
209213
/>
210-
</div>
214+
</Container>
211215
<div className={styles.learningOverview}>
212216
<OperationalLearningMap
213217
learningByCountry={learningStatsResponse?.learning_by_country}

app/src/views/OperationalLearning/Stats/styles.module.css

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,12 @@
33
flex-direction: column;
44
gap: var(--go-ui-spacing-md);
55

6-
.key-figure-list {
7-
display: grid;
8-
grid-gap: var(--go-ui-spacing-2xs);
9-
grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
10-
11-
.key-figure {
12-
border: var(--go-ui-width-separator-sm) solid var(--go-ui-color-separator);
13-
border-radius: var(--go-ui-border-radius-lg);
14-
background-color: var(--go-ui-color-white);
15-
padding: var(--go-ui-spacing-lg) var(--go-ui-spacing-md);
16-
height: 100%;
17-
}
6+
.key-figure {
7+
border: var(--go-ui-width-separator-sm) solid var(--go-ui-color-separator);
8+
border-radius: var(--go-ui-border-radius-lg);
9+
background-color: var(--go-ui-color-white);
10+
padding: var(--go-ui-spacing-lg) var(--go-ui-spacing-md);
11+
height: 100%;
1812
}
1913

2014
.learning-overview {

0 commit comments

Comments
 (0)