chore(react/collections/table): reintroduce icon while editing

This commit is contained in:
Elian Doran 2025-09-11 20:07:01 +03:00
parent 1ce42d1301
commit 228a1ad0da
No known key found for this signature in database
2 changed files with 7 additions and 6 deletions

View file

@ -154,6 +154,8 @@
.board-view-container .board-note.editing {
box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.35);
border-color: var(--main-text-color);
display: flex;
align-items: center;
}
.board-view-container .board-note.editing input {

View file

@ -373,6 +373,7 @@ function Card({
isDragging: boolean
}) {
const { branchIdToEdit } = useContext(BoardViewContext);
const isEditing = branch.branchId === branchIdToEdit;
const colorClass = note.getColorClass() || '';
const handleDragStart = useCallback((e: DragEvent) => {
@ -391,17 +392,15 @@ function Card({
return (
<div
className={`board-note ${colorClass} ${isDragging ? 'dragging' : ''}`}
className={`board-note ${colorClass} ${isDragging ? 'dragging' : ''} ${isEditing ? "editing" : ""}`}
draggable="true"
onDragStart={handleDragStart}
onDragEnd={handleDragEnd}
onContextMenu={handleContextMenu}
>
{branch.branchId !== branchIdToEdit ? (
<>
<span class={`icon ${note.getIcon()}`} />
{note.title}
</>
<span class={`icon ${note.getIcon()}`} />
{!isEditing ? (
<>{note.title}</>
) : (
<FormTextBox
value={note.title}