Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(layout): extra padding when no note title actions
Elian Doran092c7dff6b94
diff --git a/apps/client/src/widgets/layout/NoteTitleActions.css b/apps/client/src/widgets/layout/NoteTitleActions.cssindex 084901d549..80a7a98d17 100644--- a/apps/client/src/widgets/layout/NoteTitleActions.css+++ b/apps/client/src/widgets/layout/NoteTitleActions.css@@ -4,6 +4,8 @@ body.experimental-feature-new-layout {}.title-actions {- padding: 0.75em 15px;+ &.visible {+ padding: 0.75em 15px;+ }}}diff --git a/apps/client/src/widgets/layout/NoteTitleActions.tsx b/apps/client/src/widgets/layout/NoteTitleActions.tsxindex 56bbb4b2b2..31323ccbfa 100644--- a/apps/client/src/widgets/layout/NoteTitleActions.tsx+++ b/apps/client/src/widgets/layout/NoteTitleActions.tsx@@ -1,5 +1,7 @@import "./NoteTitleActions.css";+import clsx from "clsx";+import FNote from "../../entities/fnote";import { t } from "../../services/i18n";import CollectionProperties from "../note_bars/CollectionProperties";@@ -12,10 +14,14 @@ export default function NoteTitleActions() {const isHiddenNote = note && note.noteId !== "_search" && note.noteId.startsWith("_");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 (- <div className="title-actions">- {note && noteType === "search" && <SearchProperties note={note} ntxId={ntxId} />}- {note && !isHiddenNote && noteType === "book" && <CollectionProperties note={note} />}+ <div className={clsx("title-actions", items.length > 0 && "visible")}>+ {items}</div>);}