Skip to content

Commit 893c363

Browse files
committed
fix: typing for label tippy customized props
1 parent c79d4e1 commit 893c363

File tree

2 files changed

+3
-29
lines changed

2 files changed

+3
-29
lines changed

src/Shared/Components/FormFieldWrapper/types.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,8 @@ export type FormFieldLabelProps<Layout extends LayoutType = LayoutType> = LabelO
5656
/**
5757
* Tippy configuration for the label in column layout
5858
*/
59-
labelTippyCustomizedConfig?: Pick<
60-
TippyCustomizedProps,
61-
'heading' | 'infoText' | 'documentationLink' | 'documentationLinkText'
62-
>
59+
labelTippyCustomizedConfig?: Required<Pick<TippyCustomizedProps, 'heading' | 'infoText'>> &
60+
Pick<TippyCustomizedProps, 'documentationLink' | 'documentationLinkText'>
6361
})
6462

6563
export interface FormFieldInfoProps extends Pick<FormFieldLabelProps, 'inputId'> {

src/Shared/Components/ReactSelect/utils.tsx

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
*/
1616

1717
import { cloneElement } from 'react'
18-
import Tippy from '@tippyjs/react'
1918
import { components, MenuListProps, StylesConfig, ValueContainerProps } from 'react-select'
20-
import { OptionType, Progressing, stopPropagation } from '../../../Common'
19+
import { OptionType, Progressing } from '../../../Common'
2120
import { ReactComponent as ICSearch } from '../../../Assets/Icon/ic-search.svg'
2221
import { ReactComponent as ICFilter } from '../../../Assets/Icon/ic-filter.svg'
2322
import { ReactComponent as ICFilterApplied } from '../../../Assets/Icon/ic-filter-applied.svg'
@@ -181,29 +180,6 @@ export const getCustomOptionSelectionStyle =
181180
...styleOverrides,
182181
})
183182

184-
export const SelectOption = (props: any) => {
185-
const { selectProps, data, showTippy, style, placement, tippyContent, tippyClass } = props
186-
selectProps.styles.option = getCustomOptionSelectionStyle(style)
187-
const getOption = () => (
188-
<div onClick={stopPropagation}>
189-
<components.Option {...props} />
190-
</div>
191-
)
192-
193-
return showTippy ? (
194-
<Tippy
195-
className={tippyClass || 'default-white'}
196-
arrow={false}
197-
placement={placement || 'right'}
198-
content={tippyContent || data.label}
199-
>
200-
{getOption()}
201-
</Tippy>
202-
) : (
203-
getOption()
204-
)
205-
}
206-
207183
export const LoadingIndicator = () => <Progressing />
208184

209185
export const GroupHeading = (props: any) => {

0 commit comments

Comments
 (0)