Skip to content

Commit

Permalink
refactor: [1주차 리뷰] optional 지정 및 Pick 타입 사용
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyoeunkh committed Jun 30, 2024
1 parent e0a9e94 commit eb79af2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Form/Input/UnderlineTextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { css } from '@emotion/react';
import styled from '@emotion/styled';

export interface IUnderlineTextField extends React.ComponentProps<'input'> {
invalid: boolean;
invalid?: boolean;
variant: 'small' | 'large' | 'responsive';
}

export const UnderlineTextField = ({ invalid = false, variant = 'responsive', ...rest }: IUnderlineTextField) => {
return <StyleInput invalid={invalid} variant={variant} {...rest}></StyleInput>;
return <StyleInput invalid={invalid} variant={variant} {...rest} />;
};

const sizeStyles = {
Expand Down Expand Up @@ -40,7 +40,7 @@ const sizeStyles = {
`,
};

const StyleInput = styled.input<IUnderlineTextField>`
const StyleInput = styled.input<Pick<IUnderlineTextField, 'invalid' | 'variant'>>`
width: 100%;
padding: 12px 20px;
margin: 8px 0;
Expand Down

0 comments on commit eb79af2

Please sign in to comment.