mirror of
https://github.com/zadam/trilium.git
synced 2025-10-21 07:38:53 +02:00
chore(react/collections/list): add class to title
This commit is contained in:
parent
c13f5a9b04
commit
a9c5a3105f
@ -54,7 +54,7 @@ function NoteCard({ note, expand }: { note: FNote, expand?: boolean }) {
|
||||
/>
|
||||
|
||||
<Icon className="note-icon" icon={note.getIcon()} />
|
||||
<NoteLink notePath={notePath} noPreview showNotePath={isSearch} />
|
||||
<NoteLink className="note-book-title" notePath={notePath} noPreview showNotePath={isSearch} />
|
||||
{isExpanded && <>
|
||||
<NoteContent note={note} />
|
||||
<NoteChildren note={note} />
|
||||
|
@ -3,6 +3,7 @@ import link from "../../services/link";
|
||||
import RawHtml from "./RawHtml";
|
||||
|
||||
interface NoteLinkOpts {
|
||||
className?: string;
|
||||
notePath: string | string[];
|
||||
showNotePath?: boolean;
|
||||
showNoteIcon?: boolean;
|
||||
@ -11,7 +12,7 @@ interface NoteLinkOpts {
|
||||
noTnLink?: boolean;
|
||||
}
|
||||
|
||||
export default function NoteLink({ notePath, showNotePath, showNoteIcon, style, noPreview, noTnLink }: NoteLinkOpts) {
|
||||
export default function NoteLink({ className, notePath, showNotePath, showNoteIcon, style, noPreview, noTnLink }: NoteLinkOpts) {
|
||||
const stringifiedNotePath = Array.isArray(notePath) ? notePath.join("/") : notePath;
|
||||
const [ jqueryEl, setJqueryEl ] = useState<JQuery<HTMLElement>>();
|
||||
|
||||
@ -33,6 +34,10 @@ export default function NoteLink({ notePath, showNotePath, showNoteIcon, style,
|
||||
$linkEl?.addClass("tn-link");
|
||||
}
|
||||
|
||||
if (className) {
|
||||
$linkEl?.addClass(className);
|
||||
}
|
||||
|
||||
return <RawHtml html={jqueryEl} />
|
||||
|
||||
}
|
@ -61,7 +61,6 @@ class ListOrGridView extends ViewMode<{}> {
|
||||
.append(
|
||||
this.viewType === "grid"
|
||||
? $('<span class="note-book-title">').text(await treeService.getNoteTitle(note.noteId, this.parentNote.noteId))
|
||||
: (await linkService.createLink(notePath, { showNotePath: this.showNotePath })).addClass("note-book-title")
|
||||
)
|
||||
.append($renderedAttributes)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user