mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 05:15:59 +01:00
feat(react/ribbon): port note paths tab
This commit is contained in:
@@ -6,9 +6,10 @@ interface NoteLinkOpts {
|
||||
notePath: string | string[];
|
||||
showNotePath?: boolean;
|
||||
style?: Record<string, string | number>;
|
||||
noPreview?: boolean;
|
||||
}
|
||||
|
||||
export default function NoteLink({ notePath, showNotePath, style }: NoteLinkOpts) {
|
||||
export default function NoteLink({ notePath, showNotePath, style, noPreview }: NoteLinkOpts) {
|
||||
const stringifiedNotePath = Array.isArray(notePath) ? notePath.join("/") : notePath;
|
||||
const [ jqueryEl, setJqueryEl ] = useState<JQuery<HTMLElement>>();
|
||||
|
||||
@@ -21,6 +22,13 @@ export default function NoteLink({ notePath, showNotePath, style }: NoteLinkOpts
|
||||
jqueryEl?.css(style);
|
||||
}
|
||||
|
||||
const $linkEl = jqueryEl?.find("a");
|
||||
if (noPreview) {
|
||||
$linkEl?.addClass("no-tooltip-preview");
|
||||
}
|
||||
|
||||
$linkEl?.addClass("tn-link");
|
||||
|
||||
return <RawHtml html={jqueryEl} />
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user