From fffa8648bb46f6e0547797eeea9d27dce563b8de Mon Sep 17 00:00:00 2001 From: rahulramesha <71900764+rahulramesha@users.noreply.github.com> Date: Tue, 30 Jul 2024 19:32:24 +0530 Subject: [PATCH] Space app Kanban block reactions (#5272) --- .../issue-layouts/kanban/block-reactions.tsx | 45 +++++++++ .../issues/issue-layouts/kanban/block.tsx | 22 +++-- .../components/issues/peek-overview/index.ts | 2 - .../issues/peek-overview/issue-reaction.tsx | 2 +- .../core/components/issues/reactions/index.ts | 2 + .../issue-emoji-reactions.tsx | 91 ++++++++++--------- .../issue-vote-reactions.tsx | 13 ++- 7 files changed, 117 insertions(+), 60 deletions(-) create mode 100644 space/core/components/issues/issue-layouts/kanban/block-reactions.tsx create mode 100644 space/core/components/issues/reactions/index.ts rename space/core/components/issues/{peek-overview => reactions}/issue-emoji-reactions.tsx (57%) rename space/core/components/issues/{peek-overview => reactions}/issue-vote-reactions.tsx (90%) diff --git a/space/core/components/issues/issue-layouts/kanban/block-reactions.tsx b/space/core/components/issues/issue-layouts/kanban/block-reactions.tsx new file mode 100644 index 0000000000..241a087e78 --- /dev/null +++ b/space/core/components/issues/issue-layouts/kanban/block-reactions.tsx @@ -0,0 +1,45 @@ +import { observer } from "mobx-react"; +import { useParams } from "next/navigation"; +//plane +import { cn } from "@plane/editor"; +// components +import { IssueEmojiReactions, IssueVotes } from "@/components/issues/reactions"; +// hooks +import { usePublish } from "@/hooks/store"; + +type Props = { + issueId: string; +}; +export const BlockReactions = observer((props: Props) => { + const { issueId } = props; + const { anchor } = useParams(); + const { canVote, canReact } = usePublish(anchor.toString()); + + // if the user cannot vote or react then return empty + if (!canVote && !canReact) return <>>; + + return ( +