Skip to content

Commit

Permalink
feat: 추가된 isMyGoal 값 적용 및 일부 스타일 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Doeunnkimm committed Mar 17, 2024
1 parent 501fe23 commit 6d6258d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
11 changes: 4 additions & 7 deletions src/features/comment/CommentsBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ export const CommentsBottomSheet = ({ goalId, ...props }: CommentsBottomSheetPro
const { open } = useOverlay();
const { data } = useGetComment({ goalId });

// TODO: 응답값에 필드 추가되면 교체
const isMyGoal = true;

const handleDelete = (commentId: number) => () => {
open(({ isOpen, close }) => (
<DeleteCommentBottomSheet goalId={goalId} open={isOpen} onClose={close} commentId={commentId} />
Expand All @@ -30,16 +27,16 @@ export const CommentsBottomSheet = ({ goalId, ...props }: CommentsBottomSheetPro
return (
<CommentBottomSheetLayout total={data?.commentCount || 0} goalId={goalId} {...props}>
{data && data?.commentCount ? (
<div className="h-[360px] overflow-y-auto">
<div className="h-full overflow-y-auto">
<AnimatePresence>
{data.comments.map((comment) => (
<div className="flex flex-col gap-3xs mb-3xs" key={comment.id}>
<div className="flex flex-col gap-3xs" key={comment.id}>
<Comment
{...comment}
isDeletable={isMyGoal || comment.isMyComment}
isDeletable={data.isMyGoal || comment.isMyComment}
onDelete={handleDelete(comment.id)}
/>
<div className="h-[1px] bg-gray-20" />
<div className="h-[1px] bg-gray-20 mb-3xs" />
</div>
))}
</AnimatePresence>
Expand Down
2 changes: 1 addition & 1 deletion src/features/comment/DeleteCommentBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const DeleteCommentBottomSheet = ({ open, onClose, goalId, commentId }: D
fixedMaxHeight={150}
FooterComponent={<Footer goalId={goalId} commentId={commentId} onClose={onClose} />}
>
<Typography type="title2" className="w-full text-left px-xs">
<Typography type="title2" className="w-full text-left px-xs pt-3xs">
댓글을 삭제하시겠어요?
</Typography>
</BottomSheet>
Expand Down
1 change: 1 addition & 0 deletions src/hooks/reactQuery/comment/useGetComment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type CommentRequestParams = {
};

export type CommentResponse = {
isMyGoal: boolean;
comments: CommentProps[];
commentCount: number;
};
Expand Down

0 comments on commit 6d6258d

Please sign in to comment.