mirror of
https://github.com/prymitive/karma
synced 2026-05-21 04:33:07 +00:00
fix(ui): fix types
This commit is contained in:
committed by
Łukasz Mierzwa
parent
5304bba5cf
commit
985bdee534
@@ -2,7 +2,7 @@ import React, { FC } from "react";
|
||||
|
||||
import { observer } from "mobx-react-lite";
|
||||
|
||||
import Select from "react-select";
|
||||
import Select, { OnChangeValue } from "react-select";
|
||||
|
||||
import type { OptionT } from "Common/Select";
|
||||
import type { Settings, CollapseStateT } from "Stores/Settings";
|
||||
@@ -44,7 +44,7 @@ const AlertGroupCollapseConfiguration: FC<{
|
||||
settingsStore.alertGroupConfig.config.defaultCollapseState,
|
||||
)}
|
||||
options={Object.values(settingsStore.alertGroupConfig.options)}
|
||||
onChange={(option) =>
|
||||
onChange={(option: OnChangeValue<OptionT, false>) =>
|
||||
onCollapseChange((option as OptionT).value as CollapseStateT)
|
||||
}
|
||||
hideSelectedOptions
|
||||
|
||||
@@ -8,6 +8,7 @@ import type { Settings } from "Stores/Settings";
|
||||
import { ThemeContext } from "Components/Theme";
|
||||
import { AnimatedMenu } from "Components/Select";
|
||||
import { NewLabelName, StringToOption, OptionT } from "Common/Select";
|
||||
import { OnChangeValue } from "react-select";
|
||||
|
||||
const disabledLabel = "Disable multi-grid";
|
||||
|
||||
@@ -54,7 +55,7 @@ const GridLabelName: FC<{
|
||||
]
|
||||
: staticValues
|
||||
}
|
||||
onChange={(option) => {
|
||||
onChange={(option: OnChangeValue<OptionT, false>) => {
|
||||
settingsStore.multiGridConfig.setGridLabel((option as OptionT).value);
|
||||
}}
|
||||
components={{ Menu: AnimatedMenu }}
|
||||
|
||||
@@ -10,6 +10,7 @@ import { useFetchGet } from "Hooks/useFetchGet";
|
||||
import { ThemeContext } from "Components/Theme";
|
||||
import { AnimatedMenu } from "Components/Select";
|
||||
import { NewLabelName, StringToOption } from "Common/Select";
|
||||
import { OnChangeValue } from "react-select";
|
||||
|
||||
const SortLabelName: FC<{
|
||||
settingsStore: Settings;
|
||||
@@ -36,7 +37,7 @@ const SortLabelName: FC<{
|
||||
options={
|
||||
response ? response.map((value: string) => StringToOption(value)) : []
|
||||
}
|
||||
onChange={(option) => {
|
||||
onChange={(option: OnChangeValue<OptionT, false>) => {
|
||||
settingsStore.gridConfig.setSortLabel(
|
||||
(option as OptionT).value as string,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user