mirror of https://github.com/usememos/memos.git
fix: restore comment icon visibility for memos with no comments
The comment icon in MemoHeader was completely hidden when commentAmount
was 0 due to conditional rendering (introduced in 62646853). This
restores the previous behavior where the icon is rendered but hidden
via CSS, appearing on hover (desktop) so users can navigate to the
detail page to write the first comment.
Fixes #5592
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b623162d37
commit
90d498f5f9
|
|
@ -27,3 +27,6 @@ dist
|
|||
|
||||
# Git worktrees
|
||||
.worktrees/
|
||||
|
||||
# Claude Code
|
||||
CLAUDE.md
|
||||
|
|
|
|||
|
|
@ -52,15 +52,18 @@ const MemoHeader: React.FC<MemoHeaderProps> = ({ showCreator, showVisibility, sh
|
|||
/>
|
||||
)}
|
||||
|
||||
{!isInMemoDetailPage && commentAmount > 0 && (
|
||||
{!isInMemoDetailPage && (
|
||||
<Link
|
||||
className={cn("flex flex-row justify-start items-center rounded-md px-1 hover:opacity-80 gap-0.5")}
|
||||
className={cn(
|
||||
"flex flex-row justify-start items-center rounded-md px-1 hover:opacity-80 gap-0.5",
|
||||
commentAmount === 0 && "hidden sm:group-hover:flex",
|
||||
)}
|
||||
to={`/${memo.name}#comments`}
|
||||
viewTransition
|
||||
state={{ from: parentPage }}
|
||||
>
|
||||
<MessageCircleMoreIcon className="w-4 h-4 mx-auto text-muted-foreground" />
|
||||
<span className="text-xs text-muted-foreground">{commentAmount}</span>
|
||||
{commentAmount > 0 && <span className="text-xs text-muted-foreground">{commentAmount}</span>}
|
||||
</Link>
|
||||
)}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue