diff --git a/packages/frontend/src/components/shared/Input/Input.tsx b/packages/frontend/src/components/shared/Input/Input.tsx index a5228890..e1c84e8b 100644 --- a/packages/frontend/src/components/shared/Input/Input.tsx +++ b/packages/frontend/src/components/shared/Input/Input.tsx @@ -47,15 +47,15 @@ export const Input = ({ helperIcon: helperIconCls, } = inputTheme({ ...styleProps }); - const renderLabels = useMemo( - () => ( -
+ const renderLabels = useMemo(() => { + if (!label && !description) return null; + return ( +

{label}

{description}

- ), - [labelCls, descriptionCls, label, description], - ); + ); + }, [labelCls, descriptionCls, label, description]); const renderLeftIcon = useMemo(() => { return ( @@ -73,8 +73,9 @@ export const Input = ({ ); }, [cloneIcon, iconCls, iconContainerCls, rightIcon]); - const renderHelperText = useMemo( - () => ( + const renderHelperText = useMemo(() => { + if (!helperText) return null; + return (
{state && cloneIcon(, { @@ -82,9 +83,8 @@ export const Input = ({ })}

{helperText}

- ), - [cloneIcon, state, helperIconCls, helperText, helperTextCls], - ); + ); + }, [cloneIcon, state, helperIconCls, helperText, helperTextCls]); return (
diff --git a/packages/frontend/src/components/shared/Select/Select.tsx b/packages/frontend/src/components/shared/Select/Select.tsx index 6449449b..1d3d12b0 100644 --- a/packages/frontend/src/components/shared/Select/Select.tsx +++ b/packages/frontend/src/components/shared/Select/Select.tsx @@ -320,8 +320,9 @@ export const Select = ({ ); }, [cloneIcon, theme, rightIcon]); - const renderHelperText = useMemo( - () => ( + const renderHelperText = useMemo(() => { + if (!helperText) return null; + return (
{error && cloneIcon(, { @@ -329,9 +330,8 @@ export const Select = ({ })}

{helperText}

- ), - [cloneIcon, error, theme, helperText], - ); + ); + }, [cloneIcon, error, theme, helperText]); const isMultipleHasValue = multiple && selectedItems.length > 0; const isMultipleHasValueButNotSearchable =