fix(layout): extra padding when no note title actions

This commit is contained in:
Elian Doran
2025-12-14 21:38:02 +02:00
parent 7a1ff42d67
commit 092c7dff6b
2 changed files with 12 additions and 4 deletions

View File

@@ -4,6 +4,8 @@ body.experimental-feature-new-layout {
} }
.title-actions { .title-actions {
padding: 0.75em 15px; &.visible {
padding: 0.75em 15px;
}
} }
} }

View File

@@ -1,5 +1,7 @@
import "./NoteTitleActions.css"; import "./NoteTitleActions.css";
import clsx from "clsx";
import FNote from "../../entities/fnote"; import FNote from "../../entities/fnote";
import { t } from "../../services/i18n"; import { t } from "../../services/i18n";
import CollectionProperties from "../note_bars/CollectionProperties"; import CollectionProperties from "../note_bars/CollectionProperties";
@@ -12,10 +14,14 @@ export default function NoteTitleActions() {
const isHiddenNote = note && note.noteId !== "_search" && note.noteId.startsWith("_"); const isHiddenNote = note && note.noteId !== "_search" && note.noteId.startsWith("_");
const noteType = useNoteProperty(note, "type"); const noteType = useNoteProperty(note, "type");
const items = [
note && noteType === "search" && <SearchProperties note={note} ntxId={ntxId} />,
note && !isHiddenNote && noteType === "book" && <CollectionProperties note={note} />
].filter(Boolean);
return ( return (
<div className="title-actions"> <div className={clsx("title-actions", items.length > 0 && "visible")}>
{note && noteType === "search" && <SearchProperties note={note} ntxId={ntxId} />} {items}
{note && !isHiddenNote && noteType === "book" && <CollectionProperties note={note} />}
</div> </div>
); );
} }