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
feat(layout): add icon to the badge
Elian Doranf42031c8de42
diff --git a/apps/client/src/widgets/BreadcrumbBadges.tsx b/apps/client/src/widgets/BreadcrumbBadges.tsxindex fdc94461ba..f4f684c880 100644--- a/apps/client/src/widgets/BreadcrumbBadges.tsx+++ b/apps/client/src/widgets/BreadcrumbBadges.tsx@@ -2,6 +2,7 @@ import "./BreadcrumbBadges.css";import { ComponentChildren } from "preact";import { useIsNoteReadOnly, useNoteContext } from "./react/hooks";+import Icon from "./react/Icon";export default function NoteBadges() {return (@@ -17,15 +18,18 @@ function ReadOnlyBadge() {const isExplicitReadOnly = note?.isLabelTruthy("readOnly");return (isReadOnly &&- <Badge onClick={() => enableEditing()}>+ <Badge+ icon="bx bx-lock"+ onClick={() => enableEditing()}>{isExplicitReadOnly ? "Read-only" : "Auto read-only"}</Badge>);}-function Badge({ children, onClick }: { children: ComponentChildren, onClick?: () => void }) {+function Badge({ icon, children, onClick }: { icon: string, children: ComponentChildren, onClick?: () => void }) {return (<div className="breadcrumb-badge" onClick={onClick}>+ <Icon icon={icon} /> {children}</div>);