diff --git a/src/components/post-desktop/post-desktop.tsx b/src/components/post-desktop/post-desktop.tsx index f35f2fe1..972d2e41 100644 --- a/src/components/post-desktop/post-desktop.tsx +++ b/src/components/post-desktop/post-desktop.tsx @@ -184,6 +184,7 @@ const PostInfo = ({ openReplyModal, post, postReplyCount = 0, roles, isHidden }: [ !cid && e.preventDefault()} > {_.capitalize(t('reply'))} diff --git a/src/components/post-desktop/post-menu-desktop/post-menu-desktop.tsx b/src/components/post-desktop/post-menu-desktop/post-menu-desktop.tsx index c943afec..6e53427f 100644 --- a/src/components/post-desktop/post-menu-desktop/post-menu-desktop.tsx +++ b/src/components/post-desktop/post-menu-desktop/post-menu-desktop.tsx @@ -165,6 +165,12 @@ const PostMenuDesktop = ({ post }: { post: Comment }) => { const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss, role]); const headingId = useId(); + const handleMenuClick = () => { + if (cid) { + setMenuBtnRotated((prev) => !prev); + } + }; + const handleClose = () => setMenuBtnRotated(false); return ( @@ -173,13 +179,14 @@ const PostMenuDesktop = ({ post }: { post: Comment }) => { setMenuBtnRotated((prev) => !prev)} - style={{ transform: menuBtnRotated ? 'rotate(90deg)' : 'rotate(0deg)' }} + onClick={handleMenuClick} + style={{ transform: menuBtnRotated && cid ? 'rotate(90deg)' : 'rotate(0deg)' }} > ▶ {menuBtnRotated && + cid && createPortal(
diff --git a/src/components/post-mobile/post-menu-mobile/post-menu-mobile.tsx b/src/components/post-mobile/post-menu-mobile/post-menu-mobile.tsx index 5756654f..9764cbb8 100644 --- a/src/components/post-mobile/post-menu-mobile/post-menu-mobile.tsx +++ b/src/components/post-mobile/post-menu-mobile/post-menu-mobile.tsx @@ -148,16 +148,23 @@ const PostMenuMobile = ({ post }: { post: Comment }) => { const { getReferenceProps, getFloatingProps } = useInteractions([click, dismiss, role]); const headingId = useId(); + const handleMenuClick = () => { + if (cid) { + setIsMenuOpen((prev) => !prev); + } + }; + const handleClose = () => setIsMenuOpen(false); const isInBoardView = isBoardView(useLocation().pathname, useParams()); return ( <> - setIsMenuOpen((prev) => !prev)} ref={refs.setReference} {...getReferenceProps()}> + ... {isMenuOpen && + cid && createPortal(
@@ -171,7 +178,7 @@ const PostMenuMobile = ({ post }: { post: Comment }) => { , document.body, )} - {(isAccountMod || isAccountCommentAuthor) && ( + {(isAccountMod || isAccountCommentAuthor) && cid && (