-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PostMenu, CommentMenu을 하나의 Menu 컴포넌트로 통합 #708
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
048b1c9
refactor: (#687) 댓글 및 게시글 action 관련 상수 및 타입을 constants 및 types 폴더로 분리
inyeong-kang 072634d
chore: (#687) 모듈 오타 수정
inyeong-kang d272075
refactor: (#687) Menu 컴포넌트 구현 및 기존의 CommentMenu, PostMenu 컴포넌트 삭제
inyeong-kang 3e81a75
refactor: (#687) 컴포넌트 이름을 Menu에서 PostMenu 로 수정, 스토리 이름 수정
inyeong-kang 439871f
refactor: (#687) 타입명을 컴포넌트명과 통일
inyeong-kang 66fe09a
refactor: (#687) PostMenu의 props type을 제네릭 T로 대체
inyeong-kang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
frontend/src/components/comment/CommentList/CommentItem/CommentItem.stories.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
20 changes: 0 additions & 20 deletions
20
frontend/src/components/comment/CommentList/CommentItem/CommentMenu/CommentMenu.stories.tsx
This file was deleted.
Oops, something went wrong.
32 changes: 0 additions & 32 deletions
32
frontend/src/components/comment/CommentList/CommentItem/CommentMenu/index.tsx
This file was deleted.
Oops, something went wrong.
45 changes: 0 additions & 45 deletions
45
frontend/src/components/comment/CommentList/CommentItem/CommentMenu/style.ts
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
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
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,42 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { PostAction } from '@type/menu'; | ||
|
||
import { COMMENT_MENU } from '@constants/post'; | ||
|
||
import { MenuItem } from './types'; | ||
|
||
import Menu from '.'; | ||
|
||
const meta: Meta<typeof Menu> = { | ||
component: Menu, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof Menu>; | ||
|
||
const NOT_WRITER_POST_MENU_LIST: MenuItem<PostAction>[] = [ | ||
{ color: 'black', content: '닉네임 신고', action: 'NICKNAME_REPORT' }, | ||
{ color: 'black', content: '게시글 신고', action: 'POST_REPORT' }, | ||
]; | ||
|
||
const WRITER_POST_MENU_LIST: MenuItem<PostAction>[] = [ | ||
{ color: 'black', content: '수 정', action: 'EDIT' }, | ||
{ color: 'red', content: '삭 제', action: 'DELETE' }, | ||
]; | ||
|
||
export const NotPostWriterUser: Story = { | ||
render: () => <Menu menuList={NOT_WRITER_POST_MENU_LIST} handleMenuClick={() => {}} />, | ||
}; | ||
|
||
export const PostWriterUser: Story = { | ||
render: () => <Menu menuList={WRITER_POST_MENU_LIST} handleMenuClick={() => {}} />, | ||
}; | ||
|
||
export const CommentWriterUser: Story = { | ||
render: () => <Menu menuList={COMMENT_MENU.WRITER} handleMenuClick={() => {}} />, | ||
}; | ||
|
||
export const NotCommentWriterUser: Story = { | ||
render: () => <Menu menuList={COMMENT_MENU.NOT_WRITER} handleMenuClick={() => {}} />, | ||
}; |
13 changes: 7 additions & 6 deletions
13
.../src/components/common/PostMenu/index.tsx → ...tend/src/components/common/Menu/index.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
File renamed without changes.
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,5 @@ | ||
export interface MenuItem<T> { | ||
content: string; | ||
color: 'black' | 'red'; | ||
action: T; | ||
} |
22 changes: 0 additions & 22 deletions
22
frontend/src/components/common/PostMenu/PostMenu.stories.tsx
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 로 받는 군요!!