From 73a65dd8b02dde549e373df104a42ee5c69c9b44 Mon Sep 17 00:00:00 2001 From: JeonDoGyun Date: Tue, 7 Nov 2023 16:14:21 +0900 Subject: [PATCH] =?UTF-8?q?rechore:=20=EB=94=94=EB=A0=89=ED=86=A0=EB=A6=AC?= =?UTF-8?q?=20=EA=B5=AC=EC=A1=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit type을 관리하는 type.d.ts 파일 생성 page 디렉토리에는 page, Vpage, type만 있도록 구현 --- .../editProfile/EditAddressInputGroup.tsx | 2 +- "src/pages/signUp/\bsignupType.d.ts" | 38 +++++++++++++++++++ src/pages/signUp/SignUpType.ts | 15 -------- src/pages/signUp/VSignupPage.tsx | 2 +- .../{ => components}/AddressInputGroup.tsx | 1 - .../{ => components}/SignupInputForm.tsx | 4 +- .../{ => components}/VAddressInputGroup.tsx | 12 +++--- .../{ => components}/VSignupInputForm.tsx | 22 +---------- 8 files changed, 49 insertions(+), 47 deletions(-) create mode 100644 "src/pages/signUp/\bsignupType.d.ts" delete mode 100644 src/pages/signUp/SignUpType.ts rename src/pages/signUp/{ => components}/AddressInputGroup.tsx (96%) rename src/pages/signUp/{ => components}/SignupInputForm.tsx (99%) rename src/pages/signUp/{ => components}/VAddressInputGroup.tsx (89%) rename src/pages/signUp/{ => components}/VSignupInputForm.tsx (85%) diff --git a/src/pages/editProfile/EditAddressInputGroup.tsx b/src/pages/editProfile/EditAddressInputGroup.tsx index eae9e4db..50e914cd 100644 --- a/src/pages/editProfile/EditAddressInputGroup.tsx +++ b/src/pages/editProfile/EditAddressInputGroup.tsx @@ -1,4 +1,4 @@ -import VAddressInputGroup from 'pages/signUp/VAddressInputGroup'; +import VAddressInputGroup from 'pages/signUp/components/VAddressInputGroup'; import { useRecoilState } from 'recoil'; import { shelterSignupState } from 'recoil/shelterState'; diff --git "a/src/pages/signUp/\bsignupType.d.ts" "b/src/pages/signUp/\bsignupType.d.ts" new file mode 100644 index 00000000..cecf203e --- /dev/null +++ "b/src/pages/signUp/\bsignupType.d.ts" @@ -0,0 +1,38 @@ +import { ShelterSignupType } from 'recoil/shelterState'; + +export interface EmailConfirmProps { + isValid: boolean; + checked: boolean; +} + +export interface LoadingProps { + submitIsLoading: boolean; + duplicateCheckIsLoading: boolean; +} + +export interface EmailValidationProps { + validText: string; + inValidText: string; + emailConfirmObj: EmailConfirmProps; +} + +export interface AddressInputProps { + handleChange: (e: React.ChangeEvent) => void; + shelterInfo: ShelterSignupType; +} + +export interface VSignupInputProps { + handleChange: (event: React.ChangeEvent) => void; + handleSubmit: (e: React.FormEvent) => void; + duplicateCheck: () => void; + emailValidText: string; + emailInValidText: string; + passwordConfirm: boolean; + errors: Partial; + isLoading: LoadingProps; +} + +export interface ValidationProps { + text?: string; + className: string; +} diff --git a/src/pages/signUp/SignUpType.ts b/src/pages/signUp/SignUpType.ts deleted file mode 100644 index f7dbd366..00000000 --- a/src/pages/signUp/SignUpType.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface EmailConfirmProps { - isValid: boolean; - checked: boolean; -} - -export interface LoadingProps { - submitIsLoading: boolean; - duplicateCheckIsLoading: boolean; -} - -export interface EmailValidationProps { - validText: string; - inValidText: string; - emailConfirmObj: EmailConfirmProps; -} diff --git a/src/pages/signUp/VSignupPage.tsx b/src/pages/signUp/VSignupPage.tsx index 7dac9828..df8f5a1d 100644 --- a/src/pages/signUp/VSignupPage.tsx +++ b/src/pages/signUp/VSignupPage.tsx @@ -1,6 +1,6 @@ import Banner from 'commons/Banner'; import LogoButton from 'commons/LogoButton'; -import SignupInputForm from 'pages/signUp/SignupInputForm'; +import SignupInputForm from 'pages/signUp/components/SignupInputForm'; type Props = { redirectLoginPage: () => void; diff --git a/src/pages/signUp/AddressInputGroup.tsx b/src/pages/signUp/components/AddressInputGroup.tsx similarity index 96% rename from src/pages/signUp/AddressInputGroup.tsx rename to src/pages/signUp/components/AddressInputGroup.tsx index 1dfe37dd..8b63b6c5 100644 --- a/src/pages/signUp/AddressInputGroup.tsx +++ b/src/pages/signUp/components/AddressInputGroup.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { useRecoilState } from 'recoil'; import { shelterSignupState } from 'recoil/shelterState'; import VAddressInputGroup from './VAddressInputGroup'; diff --git a/src/pages/signUp/SignupInputForm.tsx b/src/pages/signUp/components/SignupInputForm.tsx similarity index 99% rename from src/pages/signUp/SignupInputForm.tsx rename to src/pages/signUp/components/SignupInputForm.tsx index 21087353..4093ce9a 100644 --- a/src/pages/signUp/SignupInputForm.tsx +++ b/src/pages/signUp/components/SignupInputForm.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { useRecoilState } from 'recoil'; import * as Yup from 'yup'; @@ -7,7 +7,7 @@ import { EmailConfirmProps, EmailValidationProps, LoadingProps, -} from './SignUpType'; +} from '../signupType'; import VSignupInputForm from './VSignupInputForm'; const SignupInputForm = () => { diff --git a/src/pages/signUp/VAddressInputGroup.tsx b/src/pages/signUp/components/VAddressInputGroup.tsx similarity index 89% rename from src/pages/signUp/VAddressInputGroup.tsx rename to src/pages/signUp/components/VAddressInputGroup.tsx index 47df9220..f0f2244d 100644 --- a/src/pages/signUp/VAddressInputGroup.tsx +++ b/src/pages/signUp/components/VAddressInputGroup.tsx @@ -1,13 +1,11 @@ import Container from 'commons/Container'; import Postcode from 'commons/PostCode'; -import { ShelterSignupType } from 'recoil/shelterState'; +import { AddressInputProps } from '../signupType'; -interface Props { - handleChange: (e: React.ChangeEvent) => void; - shelterInfo: ShelterSignupType; -} - -const VAddressInputGroup = ({ handleChange, shelterInfo }: Props) => { +const VAddressInputGroup = ({ + handleChange, + shelterInfo, +}: AddressInputProps) => { return (
diff --git a/src/pages/signUp/VSignupInputForm.tsx b/src/pages/signUp/components/VSignupInputForm.tsx similarity index 85% rename from src/pages/signUp/VSignupInputForm.tsx rename to src/pages/signUp/components/VSignupInputForm.tsx index 0aae3596..9cf484a1 100644 --- a/src/pages/signUp/VSignupInputForm.tsx +++ b/src/pages/signUp/components/VSignupInputForm.tsx @@ -1,25 +1,7 @@ -import AddressInputGroup from 'pages/signUp/AddressInputGroup'; +import AddressInputGroup from 'pages/signUp/components/AddressInputGroup'; import InputGroup from 'commons/InputGroup'; -import React from 'react'; import { ClipLoader } from 'react-spinners'; -import { ShelterSignupType } from 'recoil/shelterState'; -import { LoadingProps } from './SignUpType'; - -interface VSignupInputProps { - handleChange: (event: React.ChangeEvent) => void; - handleSubmit: (e: React.FormEvent) => void; - duplicateCheck: () => void; - emailValidText: string; - emailInValidText: string; - passwordConfirm: boolean; - errors: Partial; - isLoading: LoadingProps; -} - -interface ValidationProps { - text?: string; - className: string; -} +import { VSignupInputProps, ValidationProps } from '../signupType'; const ValidateText = ({ text, className }: ValidationProps) => { return text ?
{text}
: null;