From b3e751a94aa6f656752ef086817c77481e0815c9 Mon Sep 17 00:00:00 2001 From: chsua Date: Fri, 14 Jul 2023 23:37:21 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20(#24)=20post=20=EA=B4=80=EB=A0=A8=20typ?= =?UTF-8?q?e=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WrittenVoteOptionList/index.tsx | 10 +-------- frontend/src/types/post.ts | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 frontend/src/types/post.ts diff --git a/frontend/src/components/optionList/WrittenVoteOptionList/index.tsx b/frontend/src/components/optionList/WrittenVoteOptionList/index.tsx index 92ea3eea5..12895b6a2 100644 --- a/frontend/src/components/optionList/WrittenVoteOptionList/index.tsx +++ b/frontend/src/components/optionList/WrittenVoteOptionList/index.tsx @@ -1,16 +1,8 @@ -import React from 'react'; +import { WrittenVoteOptionType } from '@type/post'; import * as S from './style'; import WrittenVoteOption from './WrittenVoteOption'; -interface WrittenVoteOptionType { - id: number; - text: string; - peopleCount: number; - percent: number; - imageUrl?: string; -} - interface WrittenVoteOptionListProps { isPreview: boolean; selectedOptionId: number; diff --git a/frontend/src/types/post.ts b/frontend/src/types/post.ts new file mode 100644 index 000000000..065cc63c0 --- /dev/null +++ b/frontend/src/types/post.ts @@ -0,0 +1,22 @@ +export interface WrittenVoteOptionType { + id: number; + text: string; + peopleCount: number; + percent: number; + imageUrl?: string; +} + +export interface PostInfo { + postId: number; + title: string; + writer: { id: number; nick: string }; + content: string; + category: { id: number; name: string }[]; + startTime: string; + endTime: string; + voteInfo: { + selectedOptionId: number; + allPeopleCount: number; + options: WrittenVoteOptionType[]; + }; +}