From 1c8ceea40a25aef2bcbf7648a577b67dc314d915 Mon Sep 17 00:00:00 2001 From: shuai Date: Wed, 5 Jun 2024 16:28:44 +0800 Subject: [PATCH] fix: fix issues on reactions ui --- ui/src/components/Comment/index.tsx | 2 +- .../Detail/components/Reactions/index.tsx | 17 ++++++------ ui/src/pages/Questions/Detail/index.scss | 27 +++++-------------- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/ui/src/components/Comment/index.tsx b/ui/src/components/Comment/index.tsx index 1cb46f12..c639fc64 100644 --- a/ui/src/components/Comment/index.tsx +++ b/ui/src/components/Comment/index.tsx @@ -480,7 +480,7 @@ const Comment = ({ objectId, mode, commentId }) => {
handleSendReply({ value, type: 'comment' })} diff --git a/ui/src/pages/Questions/Detail/components/Reactions/index.tsx b/ui/src/pages/Questions/Detail/components/Reactions/index.tsx index 4cf7b454..08040631 100644 --- a/ui/src/pages/Questions/Detail/components/Reactions/index.tsx +++ b/ui/src/pages/Questions/Detail/components/Reactions/index.tsx @@ -1,5 +1,5 @@ import { FC, memo, useEffect, useState } from 'react'; -import { Button, OverlayTrigger, Tooltip } from 'react-bootstrap'; +import { Button, OverlayTrigger, Popover, Tooltip } from 'react-bootstrap'; import { useTranslation } from 'react-i18next'; import classNames from 'classnames'; @@ -44,7 +44,7 @@ const Index: FC = ({ useEffect(() => { queryReactions(objectId).then((res) => { - setReactions(res.reaction_summary); + setReactions(res?.reaction_summary); }); }, []); @@ -67,9 +67,9 @@ const Index: FC = ({ }); }; - const renderTooltip = (props) => ( - -
+ const renderPopover = (props) => ( + + {emojiMap.map((d) => ( ))} -
-
+ + ); return ( @@ -104,7 +104,7 @@ const Index: FC = ({ setReactIsActive(show)}>