Skip to content

Commit

Permalink
refactor: 에러메시지 타입 string | null로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhokim98 committed Aug 16, 2024
1 parent 01e0a15 commit e9b5876
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export interface LabelGroupInputStyleProps {}

export interface LabelGroupInputCustomProps {
labelText: string;
errorText?: string;
errorText: string | null;
}

export type LabelGroupInputOptionProps = LabelGroupInputStyleProps & LabelGroupInputCustomProps;
Expand Down
8 changes: 5 additions & 3 deletions HDesign/src/components/LabelInput/LabelInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ const LabelInput: React.FC<LabelInputProps> = forwardRef<HTMLInputElement, Label
<Text size="caption" css={labelTextStyle(theme, hasFocus, !!htmlProps.value)}>
{labelText}
</Text>
<Text size="caption" css={errorTextStyle(theme, isError ?? false)}>
{errorText}
</Text>
{errorText && (
<Text size="caption" css={errorTextStyle(theme, isError ?? false)}>
{errorText}
</Text>
)}
</Flex>
<Flex flexDirection="column" gap="0.5rem">
<Input ref={inputRef} isError={isError} placeholder={labelText} {...htmlProps} />
Expand Down
2 changes: 1 addition & 1 deletion HDesign/src/components/LabelInput/LabelInput.type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export interface LabelInputStyleProps {}

export interface LabelInputCustomProps {
labelText: string;
errorText?: string;
errorText: string | null;
isError?: boolean;
autoFocus: boolean;
}
Expand Down

0 comments on commit e9b5876

Please sign in to comment.