diff --git a/src/@types/auth.types.ts b/src/@types/auth.types.ts index 589b7210..c95769ab 100644 --- a/src/@types/auth.types.ts +++ b/src/@types/auth.types.ts @@ -1,4 +1,4 @@ -interface AuthRequest { +export interface AuthRequest { email: string; password: string; name: string; @@ -9,7 +9,7 @@ interface AuthRequest { survey: string; } -interface LoginRequest { +export interface LoginFormVlaue { email: string; password: string; } diff --git a/src/components/user/ErrorMessage.tsx b/src/components/user/ErrorMessage.tsx new file mode 100644 index 00000000..89f8e587 --- /dev/null +++ b/src/components/user/ErrorMessage.tsx @@ -0,0 +1,9 @@ +interface Props { + children: string; +} + +const ErrorMessage = ({ children }: Props) => { + return
{children}
; +}; + +export default ErrorMessage; diff --git a/src/components/user/index.ts b/src/components/user/index.ts index 4d720963..844de37c 100644 --- a/src/components/user/index.ts +++ b/src/components/user/index.ts @@ -1,5 +1,6 @@ import UserInputBox from './useInputBox/UserInputBox'; import UserEmailInputBox from './useInputBox/UserEmailInputBox'; import UserPwInputBox from './useInputBox/UserPwInputBox'; +import ErrorMessage from './ErrorMessage'; -export { UserInputBox, UserEmailInputBox, UserPwInputBox }; \ No newline at end of file +export { UserInputBox, UserEmailInputBox, UserPwInputBox, ErrorMessage }; diff --git a/src/components/user/useInputBox/UserInputBox.tsx b/src/components/user/useInputBox/UserInputBox.tsx index edea2f2c..a969e1b8 100644 --- a/src/components/user/useInputBox/UserInputBox.tsx +++ b/src/components/user/useInputBox/UserInputBox.tsx @@ -1,52 +1,49 @@ -import { useState } from 'react'; import { CloseIcon } from '@components/common/icons/Icons'; +import { UseFormRegisterReturn, UseFormSetValue } from 'react-hook-form'; +import { LoginFormVlaue } from '@/@types/auth.types'; interface Props { label: string; - type?: string; - name: string; + id: 'email' | 'password'; + type?: 'text' | 'email' | 'password'; placeholder: string; - // children: React.ReactNode; - validifyCheckList?: string[]; - // onInputBlur: VoidFunction; + register: UseFormRegisterReturn; + inputValue: string; + setValue: UseFormSetValue