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) {