mirror of
https://github.com/zadam/trilium.git
synced 2025-11-06 05:15:59 +01:00
feat(react/ribbon): port similar notes
This commit is contained in:
@@ -5,16 +5,21 @@ import RawHtml from "./RawHtml";
|
||||
interface NoteLinkOpts {
|
||||
notePath: string | string[];
|
||||
showNotePath?: boolean;
|
||||
style?: Record<string, string | number>;
|
||||
}
|
||||
|
||||
export default function NoteLink({ notePath, showNotePath }: NoteLinkOpts) {
|
||||
export default function NoteLink({ notePath, showNotePath, style }: NoteLinkOpts) {
|
||||
const stringifiedNotePath = Array.isArray(notePath) ? notePath.join("/") : notePath;
|
||||
const [ jqueryEl, setJqueryEl ] = useState<JQuery<HTMLElement>>();
|
||||
|
||||
useEffect(() => {
|
||||
link.createLink(stringifiedNotePath, { showNotePath: true })
|
||||
link.createLink(stringifiedNotePath, { showNotePath })
|
||||
.then(setJqueryEl);
|
||||
}, [ stringifiedNotePath, showNotePath ])
|
||||
}, [ stringifiedNotePath, showNotePath ]);
|
||||
|
||||
if (style) {
|
||||
jqueryEl?.css(style);
|
||||
}
|
||||
|
||||
return <RawHtml html={jqueryEl} />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user