Skip to content

Commit 75f0140

Browse files
committed
refactor: use InfoIconTippy
1 parent 202650f commit 75f0140

File tree

4 files changed

+7
-24
lines changed

4 files changed

+7
-24
lines changed

src/Shared/Components/CustomInput/CustomInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const CustomInput = ({
4949
labelTooltipConfig,
5050
...props
5151
}: CustomInputProps) => {
52-
const inputRef = useRef<HTMLInputElement>()
52+
const inputRef = useRef<HTMLInputElement>(null)
5353

5454
useEffect(() => {
5555
setTimeout(() => {

src/Shared/Components/CustomInput/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface CustomInputProps
3030
*/
3131
shouldTrim?: boolean
3232
/**
33-
* Size of the textarea
33+
* Size of the input
3434
*
3535
* @default ComponentSizeType.large
3636
*/

src/Shared/Components/FormFieldWrapper/FormFieldLabel.tsx

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,12 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { ReactComponent as ICHelpOutline } from '@Icons/ic-help-outline.svg'
18-
import { ReactComponent as ICHelp } from '@Icons/ic-help.svg'
19-
import { TippyCustomized } from '@Common/TippyCustomized'
20-
import { TippyTheme } from '@Common/Types'
2117
import { ConditionalWrap } from '@Common/Helper'
2218
import { ReactElement } from 'react'
2319
import { Tooltip, TooltipProps } from '@Common/Tooltip'
2420
import { getFormLabelElementId } from './utils'
2521
import { FormFieldLabelProps } from './types'
22+
import { InfoIconTippy } from '..'
2623

2724
const FormFieldLabel = ({
2825
label,
@@ -74,21 +71,7 @@ const FormFieldLabel = ({
7471
{required && <span>&nbsp;</span>}
7572
</div>
7673
{!isRowLayout && labelTippyCustomizedConfig && (
77-
<TippyCustomized
78-
theme={TippyTheme.white}
79-
className="w-300 dc__align-left"
80-
placement="bottom-start"
81-
Icon={ICHelp}
82-
iconClass="fcv-5"
83-
showCloseButton
84-
trigger="click"
85-
interactive
86-
{...labelTippyCustomizedConfig}
87-
>
88-
<div className="flex cursor">
89-
<ICHelpOutline className="fcn-7 icon-dim-16 dc__no-shrink" />
90-
</div>
91-
</TippyCustomized>
74+
<InfoIconTippy placement="bottom-start" iconClass="fcv-5" {...labelTippyCustomizedConfig} />
9275
)}
9376
</div>
9477
)

src/Shared/Components/FormFieldWrapper/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { ReactElement, ReactNode } from 'react'
1818
import { TooltipProps } from '@Common/Tooltip'
19-
import { TippyCustomizedProps } from '@Common/Types'
19+
import { InfoIconTippyProps } from '@Common/Types'
2020
import { BorderConfigType, ComponentLayoutType } from '@Shared/types'
2121

2222
export type LabelOrAriaLabelType =
@@ -55,8 +55,8 @@ export type FormFieldLabelProps<Layout extends ComponentLayoutType = ComponentLa
5555
/**
5656
* Tippy configuration for the label in column layout
5757
*/
58-
labelTippyCustomizedConfig?: Required<Pick<TippyCustomizedProps, 'heading' | 'infoText'>> &
59-
Pick<TippyCustomizedProps, 'documentationLink' | 'documentationLinkText'>
58+
labelTippyCustomizedConfig?: Required<Pick<InfoIconTippyProps, 'heading' | 'infoText'>> &
59+
Pick<InfoIconTippyProps, 'documentationLink' | 'documentationLinkText'>
6060
})
6161

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

0 commit comments

Comments
 (0)