Skip to content

Commit

Permalink
rechore: 디렉토리 구조 변경
Browse files Browse the repository at this point in the history
type을 관리하는 type.d.ts 파일 생성
page 디렉토리에는 page, Vpage, type만 있도록 구현
  • Loading branch information
JeonDoGyun committed Nov 7, 2023
1 parent 4347bf1 commit 73a65dd
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 47 deletions.
2 changes: 1 addition & 1 deletion src/pages/editProfile/EditAddressInputGroup.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
38 changes: 38 additions & 0 deletions src/pages/signUp/signupType.d.ts
Original file line number Diff line number Diff line change
@@ -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<HTMLInputElement>) => void;
shelterInfo: ShelterSignupType;
}

export interface VSignupInputProps {
handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
handleSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
duplicateCheck: () => void;
emailValidText: string;
emailInValidText: string;
passwordConfirm: boolean;
errors: Partial<ShelterSignupType>;
isLoading: LoadingProps;
}

export interface ValidationProps {
text?: string;
className: string;
}
15 changes: 0 additions & 15 deletions src/pages/signUp/SignUpType.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/pages/signUp/VSignupPage.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { useRecoilState } from 'recoil';
import { shelterSignupState } from 'recoil/shelterState';
import VAddressInputGroup from './VAddressInputGroup';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -7,7 +7,7 @@ import {
EmailConfirmProps,
EmailValidationProps,
LoadingProps,
} from './SignUpType';
} from '../signupType';
import VSignupInputForm from './VSignupInputForm';

const SignupInputForm = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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<HTMLInputElement>) => void;
shelterInfo: ShelterSignupType;
}

const VAddressInputGroup = ({ handleChange, shelterInfo }: Props) => {
const VAddressInputGroup = ({
handleChange,
shelterInfo,
}: AddressInputProps) => {
return (
<Container className="flex flex-col gap-4 w-full">
<div className="flex flex-col gap-2">
Expand Down
Original file line number Diff line number Diff line change
@@ -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<HTMLInputElement>) => void;
handleSubmit: (e: React.FormEvent<HTMLFormElement>) => void;
duplicateCheck: () => void;
emailValidText: string;
emailInValidText: string;
passwordConfirm: boolean;
errors: Partial<ShelterSignupType>;
isLoading: LoadingProps;
}

interface ValidationProps {
text?: string;
className: string;
}
import { VSignupInputProps, ValidationProps } from '../signupType';

const ValidateText = ({ text, className }: ValidationProps) => {
return text ? <div className={className}>{text}</div> : null;
Expand Down

0 comments on commit 73a65dd

Please sign in to comment.