Skip to content

Commit

Permalink
feat(textfield): apply spread syntax to sing textfield InputProps
Browse files Browse the repository at this point in the history
  • Loading branch information
LTakhyunKim committed Oct 12, 2023
1 parent 9d87c79 commit 3172c3e
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions packages/design-system/src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const SingleTextField = (props: SingleTextFieldProps) => {
rightIconSx,
onLeftIconClick,
onRightIconClick,
InputProps,
...restProps
} = props;

Expand All @@ -28,20 +29,23 @@ const SingleTextField = (props: SingleTextFieldProps) => {
hasLeftIcon={Boolean(leftIcon)}
hasRightIcon={Boolean(rightIcon)}
InputProps={{
startAdornment: leftIcon && (
<TextFieldIcon
sx={{ marginRight: "4px", ...leftIconSx }}
icon={leftIcon}
onIconClick={onLeftIconClick}
/>
),
endAdornment: rightIcon && (
<TextFieldIcon
sx={{ marginLeft: "4px", ...rightIconSx }}
icon={rightIcon}
onIconClick={onRightIconClick}
/>
),
...{
startAdornment: leftIcon && (
<TextFieldIcon
sx={{ marginRight: "4px", ...leftIconSx }}
icon={leftIcon}
onIconClick={onLeftIconClick}
/>
),
endAdornment: rightIcon && (
<TextFieldIcon
sx={{ marginLeft: "4px", ...rightIconSx }}
icon={rightIcon}
onIconClick={onRightIconClick}
/>
),
},
...InputProps,
}}
/>
);
Expand Down

0 comments on commit 3172c3e

Please sign in to comment.