Skip to content

Commit

Permalink
refactor: 헤더 상수 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
jhj2713 committed Aug 11, 2024
1 parent dc223db commit 0bd67fa
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 27 deletions.
9 changes: 9 additions & 0 deletions admin/src/constants/lottery.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export const LOTTERY_HEADER = [
"시작 날짜",
"시작 시간",
"종료 날짜",
"종료 시간",
"활성화 기간",
"추첨 당첨 인원 수",
"진행 상태",
];
13 changes: 13 additions & 0 deletions admin/src/constants/rush.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export const EVENT_LIST_HEADER = [
"ID",
"이벤트 진행 날짜",
"오픈 시간",
"종료 시간",
"활성화 시간",
"선택지 관리",
"경품 관리",
"선착순 당첨 인원 수",
"진행 상태",
"참여자 리스트 보기",
"관리",
];
19 changes: 2 additions & 17 deletions admin/src/features/Rush/EventList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,13 @@ import Button from "@/components/Button";
import DatePicker from "@/components/DatePicker";
import Table from "@/components/Table";
import TimePicker from "@/components/TimePicker";
import { EVENT_LIST_HEADER } from "@/constants/rush";
import useRushEventDispatchContext from "@/hooks/useRushEventDispatchContext";
import useRushEventStateContext from "@/hooks/useRushEventStateContext";
import { RUSH_ACTION } from "@/types/rush";
import { getTimeDifference } from "@/utils/getTimeDifference";

interface EventListProps {}

const EVENT_LIST_HEADER = [
"ID",
"이벤트 진행 날짜",
"오픈 시간",
"종료 시간",
"활성화 시간",
"선택지 관리",
"경품 관리",
"선착순 당첨 인원 수",
"진행 상태",
"참여자 리스트 보기",
"관리",
];

export default function EventList({}: EventListProps) {
export default function EventList() {
const navigate = useNavigate();

const { rushList } = useRushEventStateContext();
Expand Down
11 changes: 1 addition & 10 deletions admin/src/pages/Lottery/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,9 @@ import DatePicker from "@/components/DatePicker";
import TabHeader from "@/components/TabHeader";
import Table from "@/components/Table";
import TimePicker from "@/components/TimePicker";
import { LOTTERY_HEADER } from "@/constants/lottery";
import { LotteryType } from "@/types/lottery";

const LOTTERY_HEADER = [
"시작 날짜",
"시작 시간",
"종료 날짜",
"종료 시간",
"활성화 기간",
"추첨 당첨 인원 수",
"진행 상태",
];

export default function Lottery() {
const navigate = useNavigate();

Expand Down

0 comments on commit 0bd67fa

Please sign in to comment.