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
chore(react/ribbon): similar notes style
Elian Doran2c33ef2b0d6b
diff --git a/apps/client/src/widgets/react/NoteLink.tsx b/apps/client/src/widgets/react/NoteLink.tsxindex b7f3a3409a..ec3c336405 100644--- a/apps/client/src/widgets/react/NoteLink.tsx+++ b/apps/client/src/widgets/react/NoteLink.tsx@@ -7,9 +7,10 @@ interface NoteLinkOpts {showNotePath?: boolean;style?: Record<string, string | number>;noPreview?: boolean;+ noTnLink?: boolean;}-export default function NoteLink({ notePath, showNotePath, style, noPreview }: NoteLinkOpts) {+export default function NoteLink({ notePath, showNotePath, style, noPreview, noTnLink }: NoteLinkOpts) {const stringifiedNotePath = Array.isArray(notePath) ? notePath.join("/") : notePath;const [ jqueryEl, setJqueryEl ] = useState<JQuery<HTMLElement>>();@@ -27,7 +28,9 @@ export default function NoteLink({ notePath, showNotePath, style, noPreview }: N$linkEl?.addClass("no-tooltip-preview");}- $linkEl?.addClass("tn-link");+ if (!noTnLink) {+ $linkEl?.addClass("tn-link");+ }return <RawHtml html={jqueryEl} />diff --git a/apps/client/src/widgets/ribbon/SimilarNotesTab.tsx b/apps/client/src/widgets/ribbon/SimilarNotesTab.tsxindex b771f13bc0..57299c92c1 100644--- a/apps/client/src/widgets/ribbon/SimilarNotesTab.tsx+++ b/apps/client/src/widgets/ribbon/SimilarNotesTab.tsx@@ -23,18 +23,24 @@ export default function SimilarNotesTab({ note }: TabContext) {}, [ note?.noteId ]);return (- <div className="similar-notes-wrapper">- {similarNotes?.length ? (- <div>- {similarNotes.map(({notePath, score}) => (- <NoteLink notePath={notePath} style={{- "font-size": 24 * (1 - 1 / (1 + score))- }}/>- ))}- </div>- ) : (- <>{t("similar_notes.no_similar_notes_found")}</>- )}+ <div className="similar-notes-widget">+ <div className="similar-notes-wrapper">+ {similarNotes?.length ? (+ <div>+ {similarNotes.map(({notePath, score}) => (+ <NoteLink+ notePath={notePath}+ noTnLink+ style={{+ "font-size": 24 * (1 - 1 / (1 + score))+ }}+ />+ ))}+ </div>+ ) : (+ <>{t("similar_notes.no_similar_notes_found")}</>+ )}+ </div></div>)}\ No newline at end of file