Skip to content

Commit

Permalink
style: text color & position (#1692)
Browse files Browse the repository at this point in the history
* feat: developed reaction selector component

* feat add reaction on issue & issue comment

refactor: reaction selector component, made hooks to abstracted reaction logic & state by making custom hook

* fix: emoji.helper.tsx function

* refactor: reaction not working on inbox issue

* fix: user not been passed to create/delete function

* style: text position & color
  • Loading branch information
dakshesh14 committed Jul 28, 2023
1 parent bedc3ab commit 8930840
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
10 changes: 9 additions & 1 deletion apps/app/components/issues/comment/comment-reaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,16 @@ export const CommentReaction: React.FC<Props> = (props) => {
: "bg-custom-background-80"
}`}
>
<span>{groupedReactions?.[reaction].length} </span>
<span>{renderEmoji(reaction)}</span>
<span
className={
commentReactions?.some((r) => r.actor === user?.id && r.reaction === reaction)
? "text-custom-primary-100"
: ""
}
>
{groupedReactions?.[reaction].length}{" "}
</span>
</button>
)
)}
Expand Down
10 changes: 9 additions & 1 deletion apps/app/components/issues/issue-reaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,16 @@ export const IssueReaction: React.FC<Props> = (props) => {
: "bg-custom-background-80"
}`}
>
<span>{groupedReactions?.[reaction].length} </span>
<span>{renderEmoji(reaction)}</span>
<span
className={
reactions?.some((r) => r.actor === user?.id && r.reaction === reaction)
? "text-custom-primary-100"
: ""
}
>
{groupedReactions?.[reaction].length}{" "}
</span>
</button>
)
)}
Expand Down
6 changes: 4 additions & 2 deletions apps/app/hooks/use-comment-reaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const useCommentReaction = (
workspaceSlug.toString(),
projectId.toString(),
commendId.toString(),
{ reaction }
{ reaction },
user.user
);

mutateCommentReactions((prev) => [...(prev || []), data]);
Expand All @@ -76,7 +77,8 @@ const useCommentReaction = (
workspaceSlug.toString(),
projectId.toString(),
commendId.toString(),
reaction
reaction,
user.user
);

mutateCommentReactions();
Expand Down
6 changes: 4 additions & 2 deletions apps/app/hooks/use-issue-reaction.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const useIssueReaction = (
workspaceSlug.toString(),
projectId.toString(),
issueId.toString(),
{ reaction }
{ reaction },
user.user
);

mutateReaction((prev) => [...(prev || []), data]);
Expand All @@ -77,7 +78,8 @@ const useIssueReaction = (
workspaceSlug.toString(),
projectId.toString(),
issueId.toString(),
reaction
reaction,
user.user
);

mutateReaction();
Expand Down

1 comment on commit 8930840

@vercel
Copy link

@vercel vercel bot commented on 8930840 Jul 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plane-dev – ./apps/app

plane-dev.vercel.app
plane-dev-plane.vercel.app
plane-dev-git-develop-plane.vercel.app

Please sign in to comment.