Skip to content

Commit 6685d64

Browse files
committed
feat: add typing on style utils
1 parent 42d1d75 commit 6685d64

File tree

1 file changed

+4
-3
lines changed
  • src/Shared/Components/SelectPicker

1 file changed

+4
-3
lines changed

src/Shared/Components/SelectPicker/utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { ComponentSizeType } from '@Shared/constants'
2-
import { SelectPickerProps } from './type'
2+
import { StylesConfig } from 'react-select'
3+
import { SelectPickerOptionType, SelectPickerProps } from './type'
34

4-
const getMenuWidthFromSize = (menuSize: SelectPickerProps['menuSize']) => {
5+
const getMenuWidthFromSize = (menuSize: SelectPickerProps['menuSize']): string => {
56
switch (menuSize) {
67
case ComponentSizeType.medium:
78
return '125%'
@@ -17,7 +18,7 @@ export const getCommonSelectStyle = ({
1718
error,
1819
size,
1920
menuSize,
20-
}: Pick<SelectPickerProps, 'error' | 'size' | 'menuSize'>) => ({
21+
}: Pick<SelectPickerProps, 'error' | 'size' | 'menuSize'>): StylesConfig<SelectPickerOptionType> => ({
2122
container: (base, state) => ({
2223
...base,
2324
...(state.isDisabled && {

0 commit comments

Comments
 (0)