From e9fbb4d951a183dafa2d329e78fd001c701a081c Mon Sep 17 00:00:00 2001 From: Emmanuel Date: Tue, 3 Dec 2024 14:54:22 +0000 Subject: [PATCH] 2.5.1 --- package.json | 2 +- src/pages/StatsTracking.tsx | 16 +++++++--------- src/pages/TrackingPage.tsx | 4 +--- src/ui/Select.tsx | 7 ++----- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index f43ef2d3..1006dd9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pearl", - "version": "2.5.0", + "version": "2.5.1", "private": true, "dependencies": { "@emotion/react": "^11.11.1", diff --git a/src/pages/StatsTracking.tsx b/src/pages/StatsTracking.tsx index ef4ea067..c55ed00d 100644 --- a/src/pages/StatsTracking.tsx +++ b/src/pages/StatsTracking.tsx @@ -1,13 +1,13 @@ -import { Box, Card, CardContent, Stack, Typography, Grid, SelectChangeEvent } from '@mui/material'; -import { useState, useMemo, SetStateAction } from 'react'; +import { Box, Card, CardContent, Grid, SelectChangeEvent, Stack, Typography } from '@mui/material'; +import D from 'i18n'; +import { useMemo, useState } from 'react'; +import { SurveyUnit } from 'types/pearl'; +import { ScrollableBox } from 'ui/ScrollableBox'; +import { Select } from 'ui/Select'; import { CampaignProgress } from 'ui/Stats/CampaignProgress'; import { CampaignProgressPieChart } from 'ui/Stats/CampaignProgressPieChart'; import { daysLeftForSurveyUnit } from 'utils/functions'; import { groupBy } from 'utils/functions/array'; -import D from 'i18n'; -import { SurveyUnit } from 'types/pearl'; -import { Select } from 'ui/Select'; -import { ScrollableBox } from 'ui/ScrollableBox'; type SortDirection = 'asc' | 'desc' | 'deadlineDesc' | 'deadlineAsc'; @@ -78,9 +78,7 @@ export function StatsTracking({ surveyUnits }: Readonly) { ) => - setCampaign(e.target.value as string) - } + onChange={e => setCampaign(e.target.value as string)} sx={{ minWidth: 210 }} value={campaign} placeholder={D.trackingSelect} diff --git a/src/ui/Select.tsx b/src/ui/Select.tsx index e5f2bca4..541cef7e 100644 --- a/src/ui/Select.tsx +++ b/src/ui/Select.tsx @@ -1,13 +1,10 @@ import MenuItem from '@mui/material/MenuItem'; -import SelectMaterial, { SelectChangeEvent } from '@mui/material/Select'; -import React, { ReactNode } from 'react'; +import SelectMaterial, { SelectProps as MaterialSelectProps } from '@mui/material/Select'; -// extends React.ComponentProps -interface SelectProps extends React.ComponentProps { +interface SelectProps extends MaterialSelectProps { options: { value: string | number; label: string }[]; placeholder: string; allowEmpty: boolean; - onChange: (e: SelectChangeEvent, child: ReactNode) => void; } export function Select({ options, placeholder, allowEmpty, ...props }: Readonly) {