Skip to content
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

chore: reduce comment form indentation #45

Merged
merged 1 commit into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/pages/Articles/components/commentComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const CommentComponent: FunctionComponent<{ comment: IArticleComments, level: nu

return (
<Fragment>
<Box mb={"5px"} ml={`${level * 10}px`}> {/* Indent based on level */}
<Box mb={"5px"}> {/* Indent based on level */}
<Box
display={"flex"}
justifyContent={"flex-start"}
Expand Down Expand Up @@ -203,15 +203,15 @@ const CommentComponent: FunctionComponent<{ comment: IArticleComments, level: nu

{/* Render nested replies */}
{comment.replies && comment.replies.length > 0 && (
<>
<Box ml={`${level * 10}px`}>
{showAllReplies
? comment.replies.map(reply => (
<CommentComponent key={reply.id} comment={reply} level={level + 1} />
))
: comment.replies.slice(0, 1).map(reply => (
<CommentComponent key={reply.id} comment={reply} level={level + 1} />
))}
</>
</Box>
)}

<ShowLoginModal isOpen={isOpen} onClose={onClose} />
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Threads/components/commentComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const CommentComponent: FunctionComponent<{ comment: IThreadComments, level: num

return (
<Fragment>
<Box mb={"5px"} ml={`${level * 20}px`}>
<Box mb={"5px"}>
<Flex flex="1" gap={2} alignItems="flex-start" flexWrap="wrap">
<Link to={`/user/${comment?.user?.username}`}>
<Avatar size={"xs"} name={comment?.user?.fullname} src={comment?.user?.avatar} />
Expand Down Expand Up @@ -176,15 +176,15 @@ const CommentComponent: FunctionComponent<{ comment: IThreadComments, level: num

{/* Render nested replies */}
{comment.replies && comment.replies.length > 0 && (
<>
<Box ml={`${level * 20}px`}>
{showAllReplies
? comment.replies.map(reply => (
<CommentComponent key={reply.id} comment={reply} level={level + 1} />
))
: comment.replies.slice(0, 1).map(reply => (
<CommentComponent key={reply.id} comment={reply} level={level + 1} />
))}
</>
</Box>
)}
</Box>

Expand Down
Loading