Skip to content

Commit

Permalink
rename: steList 타입 파일 useStepList 폴더로 이동 후 type.ts로 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
soi-ha committed Jul 26, 2024
1 parent 24ffed1 commit 7712a11
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 41 deletions.
2 changes: 0 additions & 2 deletions client/src/apis/request/bill.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {Bill} from 'types/stepList';

import {BASE_URL} from '@apis/baseUrl';
import {TEMP_PREFIX} from '@apis/tempPrefix';
import {requestPost} from '@apis/fetcher';
Expand Down
2 changes: 0 additions & 2 deletions client/src/apis/request/member.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {MemberType} from 'types/stepList';

import {BASE_URL} from '@apis/baseUrl';
import {TEMP_PREFIX} from '@apis/tempPrefix';
import {requestPost} from '@apis/fetcher';
Expand Down
2 changes: 0 additions & 2 deletions client/src/apis/request/report.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {MemberReport} from 'types/stepList';

import {BASE_URL} from '@apis/baseUrl';
import {TEMP_PREFIX} from '@apis/tempPrefix';
import {requestGet} from '@apis/fetcher';
Expand Down
2 changes: 0 additions & 2 deletions client/src/apis/request/stepList.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import {StepList} from 'types/stepList';

import {BASE_URL} from '@apis/baseUrl';
import {TEMP_PREFIX} from '@apis/tempPrefix';
import {requestGet} from '@apis/fetcher';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import {useState} from 'react';
import {BottomSheet, Switch} from 'haengdong-design';

import {InOutType} from '@pages/Event/Admin/Admin';

import SetPurchase from './SetPurchase';
import UpdateParticipants from './UpdateParticipants';
import {setActionModalContentStyle, setActionModalContentSwitchContainerStyle} from './SetActionModalContent.style';
Expand All @@ -11,17 +9,11 @@ export type ActionType = '지출' | '인원';

interface SetActionModalContentProps {
openBottomSheet: boolean;

setOpenBottomSheet: React.Dispatch<React.SetStateAction<boolean>>;
setOrder: React.Dispatch<React.SetStateAction<number>>;
}

const SetActionModalContent = ({
openBottomSheet,

setOpenBottomSheet,
setOrder,
}: SetActionModalContentProps) => {
const SetActionModalContent = ({openBottomSheet, setOpenBottomSheet, setOrder}: SetActionModalContentProps) => {
const [action, setAction] = useState<ActionType>('지출');
const [inOutAction, setInOutAction] = useState<InOutType>('탈주');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {Input, FixedButton} from 'haengdong-design';

import {useStepList} from '@hooks/useStepList/useStepList';
import {MemberType} from 'types/stepList';

import useDynamicInput from '@hooks/useDynamicAdditionalInput';

Expand Down
2 changes: 0 additions & 2 deletions client/src/hooks/useDynamicInputPairs.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {useEffect, useRef, useState} from 'react';

import {Bill} from 'types/stepList';

const useDynamicInputPairs = () => {
const [inputPairs, setInputPairs] = useState<Bill[]>([{title: '', price: 0}]);
const inputRefs = useRef<(HTMLInputElement | null)[]>([]);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {useEffect, useState} from 'react';

import {MemberReport} from 'types/stepList';
import {requestMemberReportList} from '@apis/request/report';
import useEventId from '@hooks/useEventId/useEventId';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
export type MemberType = 'IN' | 'OUT';

// TODO: (@weadie) 준 데이터 형식에서 steps를 빼내 flat하게 사용중. 일관성있게 하는게 좋긴 하나 사용시 번거로움이 있을 거라고 판단.
export type StepList = {
steps: (MemberStep | BillStep)[];
};

export type Step = {
type: MemberType | 'BILL';
stepName: string | null;
Expand Down Expand Up @@ -43,13 +36,3 @@ export type Member = {
name: string;
status: MemberType;
};

export type Bill = {
title: string;
price: number;
};

export type MemberReport = {
name: string;
price: number;
};
3 changes: 2 additions & 1 deletion client/src/hooks/useStepList/useStepList.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {PropsWithChildren, createContext, useContext, useEffect, useState} from 'react';

import {Bill, BillAction, BillStep, MemberStep, MemberType, StepList} from 'types/stepList';
import useEventId from '@hooks/useEventId/useEventId';
import {requestAddBillList} from '@apis/request/bill';
import {requestUpdateMemberList} from '@apis/request/member';
import {requestStepList} from '@apis/request/stepList';

import {BillAction, BillStep, MemberStep} from './type.ts';

interface StepListContextProps {
stepList: (BillStep | MemberStep)[];
getTotalPrice: () => number;
Expand Down
2 changes: 0 additions & 2 deletions client/src/pages/Event/Admin/Admin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export type PurchaseInformation = {
price: number;
};

export type InOutType = '늦참' | '탈주';

export type ParticipantType = {
name: string;
type: InOutType;
Expand Down
18 changes: 18 additions & 0 deletions client/src/type.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
type MemberType = 'IN' | 'OUT';

type InOutType = '늦참' | '탈주';

type MemberReport = {
name: string;
price: number;
};

type Bill = {
title: string;
price: number;
};

// TODO: (@weadie) 준 데이터 형식에서 steps를 빼내 flat하게 사용중. 일관성있게 하는게 좋긴 하나 사용시 번거로움이 있을 거라고 판단.
type StepList = {
steps: (MemberStep | BillStep)[];
};

0 comments on commit 7712a11

Please sign in to comment.