fix: 笔记列表 hover 操作按钮与日期互换显示

This commit is contained in:
MikiVL 2026-05-05 03:45:05 +08:00
parent 8ce1072b0c
commit 2ade39d58f

View File

@ -582,32 +582,34 @@ function DraggableNoteItem({ note, active, editing, editValue, editRef, activeTa
</span> </span>
)} )}
</div> </div>
{hovered ? ( <div className="flex items-center gap-0.5 shrink-0">
<div className="flex items-center gap-0.5 shrink-0"> {hovered ? (
<button <>
className="toolbar-btn" <button
style={{ width: 20, height: 20, color: note.starred ? '#f59e0b' : 'var(--text-faint)' }} className="toolbar-btn"
title={note.starred ? '取消收藏' : '收藏'} style={{ width: 20, height: 20, color: note.starred ? '#f59e0b' : 'var(--text-faint)' }}
onClick={(e) => { e.stopPropagation(); onToggleStar() }} title={note.starred ? '取消收藏' : '收藏'}
> onClick={(e) => { e.stopPropagation(); onToggleStar() }}
<Star size={12} fill={note.starred ? '#f59e0b' : 'none'} /> >
</button> <Star size={12} fill={note.starred ? '#f59e0b' : 'none'} />
<button </button>
className="toolbar-btn" <button
style={{ width: 20, height: 20, color: '#ef4444', opacity: 0.8 }} className="toolbar-btn"
title="删除笔记" style={{ width: 20, height: 20, color: '#ef4444', opacity: 0.8 }}
onClick={(e) => { e.stopPropagation(); onDelete() }} title="删除笔记"
onMouseEnter={e => (e.currentTarget.style.opacity = '1')} onClick={(e) => { e.stopPropagation(); onDelete() }}
onMouseLeave={e => (e.currentTarget.style.opacity = '0.8')} onMouseEnter={e => (e.currentTarget.style.opacity = '1')}
> onMouseLeave={e => (e.currentTarget.style.opacity = '0.8')}
<Trash2 size={12} /> >
</button> <Trash2 size={12} />
</div> </button>
) : ( </>
<span className="text-xs shrink-0 mt-0.5" style={{ color: 'var(--text-faint)' }}> ) : (
{formatDate(note.updatedAt)} <span className="text-xs" style={{ color: 'var(--text-faint)' }}>
</span> {formatDate(note.updatedAt)}
)} </span>
)}
</div>
</div> </div>
{note.tags.length > 0 && ( {note.tags.length > 0 && (
<div className="flex gap-1 mt-1 flex-wrap"> <div className="flex gap-1 mt-1 flex-wrap">