-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [#38] feat:: 삭제된 댓글 Username 지정 * feat:: 게시글 댓글 익명성에 따른 ui 반영 * fix:: isAuthor 인자 추가하기 * [#38] feat:: 삭제된 댓글 Username 지정 * feat:: 게시글 댓글 익명성에 따른 ui 반영 * fix:: isAuthor 인자 추가하기
- Loading branch information
1 parent
b2aad60
commit 056bb82
Showing
9 changed files
with
79 additions
and
12 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { CommentProps } from '@/types/community' | ||
|
||
interface CommentUsernameProps { | ||
comment: CommentProps | ||
isPostAuthorAnonymous: boolean | ||
} | ||
export const getCommentUsername = ({ comment, isPostAuthorAnonymous }: CommentUsernameProps) => { | ||
if (comment.isDeleted) return 'Unknown' | ||
if (comment.isAuthor && isPostAuthorAnonymous && comment.user.isAnonymous) return 'Anonymous' | ||
return comment.user.username | ||
} |
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,13 @@ | ||
import { match } from 'ts-pattern' | ||
|
||
interface IsAuthorMatchingPostAnonymity { | ||
isPostAuthorAnonymous: boolean | ||
isAnonymous: boolean | ||
isAuthor: boolean | ||
} | ||
export const isAuthorMatchingPostAnonymity = (props: IsAuthorMatchingPostAnonymity) => { | ||
return match(props) | ||
.with({ isAuthor: true, isPostAuthorAnonymous: true, isAnonymous: true }, () => true) | ||
.with({ isAuthor: true, isPostAuthorAnonymous: false, isAnonymous: false }, () => true) | ||
.otherwise(() => false) | ||
} |
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 |
---|---|---|
|
@@ -3459,10 +3459,10 @@ lru-cache@^6.0.0: | |
dependencies: | ||
yallist "^4.0.0" | ||
|
||
lucide-react@^0.378.0: | ||
version "0.378.0" | ||
resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.378.0.tgz#232acb99c6baedfa90959a2c0dd11327b058bde8" | ||
integrity sha512-u6EPU8juLUk9ytRcyapkWI18epAv3RU+6+TC23ivjR0e+glWKBobFeSgRwOIJihzktILQuy6E0E80P2jVTDR5g== | ||
lucide-react@^0.441.0: | ||
version "0.441.0" | ||
resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.441.0.tgz#afc0d76c5ffb5bdac7adf0c9626217a5451b1af1" | ||
integrity sha512-0vfExYtvSDhkC2lqg0zYVW1Uu9GsI4knuV9GP9by5z0Xhc4Zi5RejTxfz9LsjRmCyWVzHCJvxGKZWcRyvQCWVg== | ||
|
||
[email protected]: | ||
version "0.30.8" | ||
|