Skip to content

Commit

Permalink
Merge pull request #217 from Nexters/fix/input-border
Browse files Browse the repository at this point in the history
fix: 인풋 포커스 일때만 보더 색상 검정
  • Loading branch information
alstn2468 authored Oct 11, 2024
2 parents c708537 + a8ef4ca commit 82572b0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ interface ShowInfoFormLabelProps {
}

interface InputWrapperProps {
text: string;
isError?: boolean;
}

Expand Down Expand Up @@ -46,12 +45,7 @@ const FieldWrap = styled.div`
const InputWrapper = styled.div<InputWrapperProps>`
${({ theme }) => theme.typo.b3};
border: 1px solid
${({ text, theme, isError }) =>
isError
? theme.palette.status.error
: text
? theme.palette.grey.g90
: theme.palette.grey.g20};
${({ theme, isError }) => (isError ? theme.palette.status.error : theme.palette.grey.g20)};
border-radius: 4px;
background-color: ${({ theme }) => theme.palette.grey.w};
padding: 8px 12px;
Expand All @@ -61,6 +55,12 @@ const InputWrapper = styled.div<InputWrapperProps>`
display: flex;
align-items: center;
width: 100%;
transition: border-color 0.2s ease-in-out;
&:focus-within {
border-color: ${({ theme, isError }) =>
isError ? theme.palette.status.error : theme.palette.grey.g70};
}
`;

const TextFieldWrap = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const ShowCastInfoFormDialogContent = ({ onDelete, prevShowCastInfo, onSave }: P
);
return (
<Styled.FieldWrap>
<Styled.InputWrapper text={value ?? ''} isError={isError}>
<Styled.InputWrapper isError={isError}>
{field.userImgPath && field.userNickname ? (
<>
<Styled.UserImage
Expand Down Expand Up @@ -195,10 +195,7 @@ const ShowCastInfoFormDialogContent = ({ onDelete, prevShowCastInfo, onSave }: P
const isError = isMemberFieldBlurred[index].roleName && !value;
return (
<Styled.FieldWrap>
<Styled.InputWrapper
text={value ?? ''}
isError={isMemberFieldBlurred[index].roleName && !value}
>
<Styled.InputWrapper isError={isMemberFieldBlurred[index].roleName && !value}>
<Styled.Input
placeholder="역할"
required
Expand Down

0 comments on commit 82572b0

Please sign in to comment.