style: text color & position (#1692)

* 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
This commit is contained in:
Dakshesh Jain 2023-07-28 10:46:35 +05:30 committed by GitHub
parent bedc3ab5a1
commit 8930840a76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 6 deletions

View File

@ -70,8 +70,16 @@ export const CommentReaction: React.FC<Props> = (props) => {
: "bg-custom-background-80" : "bg-custom-background-80"
}`} }`}
> >
<span>{groupedReactions?.[reaction].length} </span>
<span>{renderEmoji(reaction)}</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> </button>
) )
)} )}

View File

@ -60,8 +60,16 @@ export const IssueReaction: React.FC<Props> = (props) => {
: "bg-custom-background-80" : "bg-custom-background-80"
}`} }`}
> >
<span>{groupedReactions?.[reaction].length} </span>
<span>{renderEmoji(reaction)}</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> </button>
) )
)} )}

View File

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

View File

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