-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from js43o/mocking-mogaco-detail
[Feat] 모각코 상세 게시글 페이지 읽기 구현
- Loading branch information
Showing
15 changed files
with
262 additions
and
110 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
type DetailContentsProps = { | ||
contents: string; | ||
}; | ||
|
||
export function DetailContents({ contents }: DetailContentsProps) { | ||
return <div>{contents}</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 44 additions & 32 deletions
76
app/frontend/src/components/MogacoDetail/DetailHeaderButtons.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,55 @@ | ||
import { Button } from '@/components'; | ||
|
||
const buttonComponents = { | ||
participating: ( | ||
<Button theme="primary" shape="fill" size="large"> | ||
참석하기 | ||
</Button> | ||
), | ||
participated: ( | ||
<> | ||
<Button theme="primary" shape="fill" size="large"> | ||
채팅 | ||
</Button> | ||
<Button theme="danger" shape="fill" size="large"> | ||
참석 취소 | ||
</Button> | ||
</> | ||
), | ||
hosted: ( | ||
<> | ||
<Button theme="primary" shape="line" size="large"> | ||
수정 | ||
</Button> | ||
<Button theme="danger" shape="line" size="large"> | ||
삭제 | ||
</Button> | ||
</> | ||
), | ||
closed: ( | ||
<Button theme="primary" shape="fill" size="large" disabled> | ||
마감 | ||
</Button> | ||
), | ||
}; | ||
|
||
type DetailHeaderButtonsProps = { | ||
state: 'not-participated' | 'participated' | 'hosted'; | ||
status: '모집 중' | '마감' | '종료'; | ||
}; | ||
|
||
export function DetailHeaderButtons({ state }: DetailHeaderButtonsProps) { | ||
if (state === 'not-participated') { | ||
return ( | ||
<Button theme="primary" shape="fill" size="large"> | ||
참석하기 | ||
</Button> | ||
); | ||
} | ||
export function DetailHeaderButtons({ status }: DetailHeaderButtonsProps) { | ||
const userHosted = false; | ||
const userParticipated = false; | ||
|
||
if (state === 'participated') { | ||
return ( | ||
<> | ||
<Button theme="primary" shape="fill" size="large"> | ||
채팅 | ||
</Button> | ||
<Button theme="primary" shape="line" size="large"> | ||
참석 취소 | ||
</Button> | ||
</> | ||
); | ||
if (userHosted) { | ||
return buttonComponents.hosted; | ||
} | ||
|
||
if (state === 'hosted') { | ||
return ( | ||
<> | ||
<Button theme="primary" shape="line" size="large"> | ||
수정 | ||
</Button> | ||
<Button theme="danger" shape="line" size="large"> | ||
삭제 | ||
</Button> | ||
</> | ||
); | ||
if (status === '모집 중') { | ||
return userParticipated | ||
? buttonComponents.participated | ||
: buttonComponents.participating; | ||
} | ||
|
||
return null; | ||
return buttonComponents.closed; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import { memberAPIHandlers } from './members'; | ||
import { mogacoAPIHandlers } from './mogacos'; | ||
import { mogacoAPIHandlers } from './mogaco'; | ||
|
||
export const mockAPIhandlers = [...memberAPIHandlers, ...mogacoAPIHandlers]; |
Oops, something went wrong.