Skip to content

Commit e87b1ae

Browse files
authored
feat: note - move edit button to the line with labels
1 parent 5768830 commit e87b1ae

24 files changed

+14
-7
lines changed

src/components/NoteManager/components/Note.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,19 @@ export function Note({ note, active = false, onEditNote, onDeleteNote, onSelectN
159159
<>
160160
<NoteLayout.SelectedText />
161161
<NoteLayout.Text />
162-
<NoteLayout.Labels />
163-
{isEditable && (
164-
<div className="flex flex-1 justify-end">
165-
<TinyIconButton data-testid={"edit-button"} onClick={handleEditClick} aria-label="Edit note" icon="✏️" />
166-
</div>
167-
)}
162+
<div className="flex justify-between items-end max-w-[100%]">
163+
<NoteLayout.Labels />
164+
{isEditable && (
165+
<div className="flex flex-1 justify-end">
166+
<TinyIconButton
167+
data-testid={"edit-button"}
168+
onClick={handleEditClick}
169+
aria-label="Edit note"
170+
icon="✏️"
171+
/>
172+
</div>
173+
)}
174+
</div>
168175
</>
169176
)}
170177
{active && isEditing && (

src/components/NoteManager/components/NoteLabels.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function NoteLabels() {
1414
const labels = isEditing ? noteDirty.labels : note.original.labels;
1515

1616
return (
17-
<div className="labels items-start justify-start flex gap-x-1 gap-y-1 flex-wrap">
17+
<div className="labels items-start justify-start flex gap-x-1 gap-y-1 flex-wrap min-w-0">
1818
{labels.map((label) => (
1919
<Label
2020
key={label}
-188 Bytes
Loading
-191 Bytes
Loading
1.05 KB
Loading
1.09 KB
Loading
-167 Bytes
Loading
-179 Bytes
Loading
-163 Bytes
Loading
-156 Bytes
Loading

0 commit comments

Comments
 (0)