Skip to content

Commit

Permalink
fix: searchPrefix icon size & add Prefix container
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanna922 committed May 16, 2024
1 parent 13ec87e commit f927dbb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const SearchTextField = ({ onClickClearButton, ...props }: SearchTextFiel
<IconContext.Provider
value={{
color: theme.color.textTertiary,
size: '1.5rem',
size: '1.25rem',
}}
>
<IcSearchLine />
Expand Down
4 changes: 4 additions & 0 deletions src/components/TextField/TextField.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ export const StyledSuffixIconContainer = styled.div<StyledTextFieldProps>`
display: none;
`;

export const StyledSearchPrefixContainer = styled.div`
display: flex;
`;

export const StyledTextFieldWrapper = styled.div<StyledTextFieldProps>`
width: ${({ $width }) => $width};
height: 46px;
Expand Down
7 changes: 3 additions & 4 deletions src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
StyledFieldLabel,
StyledHelperLabel,
StyledSearchPrefixContainer,
StyledSuffixIconContainer,
StyledSuffixText,
StyledTextField,
Expand Down Expand Up @@ -31,14 +32,12 @@ export const TextField = ({
$isDisabled={props.disabled}
$width={width}
>
{searchPrefix}
<StyledSearchPrefixContainer>{searchPrefix}</StyledSearchPrefixContainer>
<StyledTextField {...props} />
{typeof suffix === 'string' ? (
<StyledSuffixText $isDisabled={props.disabled}>{suffix}</StyledSuffixText>
) : (
<StyledSuffixIconContainer $isDisabled={props.disabled}>
{suffix}
</StyledSuffixIconContainer>
<StyledSuffixIconContainer>{suffix}</StyledSuffixIconContainer>
)}
</StyledTextFieldWrapper>
{helperLabel && (
Expand Down

0 comments on commit f927dbb

Please sign in to comment.