mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 07:08:55 +02:00
refactor(collections): delete unnecessary type parameter
This commit is contained in:
parent
d9906a4a47
commit
e0e791d9b4
@ -13,7 +13,7 @@ import { subscribeToMessages, unsubscribeToMessage as unsubscribeFromMessage } f
|
|||||||
import { WebSocketMessage } from "@triliumnext/commons";
|
import { WebSocketMessage } from "@triliumnext/commons";
|
||||||
import froca from "../../services/froca";
|
import froca from "../../services/froca";
|
||||||
|
|
||||||
interface NoteListProps<T extends object> {
|
interface NoteListProps {
|
||||||
note: FNote | null | undefined;
|
note: FNote | null | undefined;
|
||||||
notePath: string | null | undefined;
|
notePath: string | null | undefined;
|
||||||
highlightedTokens?: string[] | null;
|
highlightedTokens?: string[] | null;
|
||||||
@ -23,17 +23,17 @@ interface NoteListProps<T extends object> {
|
|||||||
ntxId: string | null | undefined;
|
ntxId: string | null | undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function NoteList<T extends object>(props: Pick<NoteListProps<T>, "displayOnlyCollections">) {
|
export default function NoteList<T extends object>(props: Pick<NoteListProps, "displayOnlyCollections">) {
|
||||||
const { note, noteContext, notePath, ntxId } = useNoteContext();
|
const { note, noteContext, notePath, ntxId } = useNoteContext();
|
||||||
const isEnabled = noteContext?.hasNoteList();
|
const isEnabled = noteContext?.hasNoteList();
|
||||||
return <CustomNoteList note={note} isEnabled={!!isEnabled} notePath={notePath} ntxId={ntxId} {...props} />
|
return <CustomNoteList note={note} isEnabled={!!isEnabled} notePath={notePath} ntxId={ntxId} {...props} />
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SearchNoteList<T extends object>(props: Omit<NoteListProps<T>, "isEnabled">) {
|
export function SearchNoteList<T extends object>(props: Omit<NoteListProps, "isEnabled">) {
|
||||||
return <CustomNoteList {...props} isEnabled={true} />
|
return <CustomNoteList {...props} isEnabled={true} />
|
||||||
}
|
}
|
||||||
|
|
||||||
function CustomNoteList<T extends object>({ note, isEnabled: shouldEnable, notePath, highlightedTokens, displayOnlyCollections, ntxId }: NoteListProps<T>) {
|
function CustomNoteList<T extends object>({ note, isEnabled: shouldEnable, notePath, highlightedTokens, displayOnlyCollections, ntxId }: NoteListProps) {
|
||||||
const widgetRef = useRef<HTMLDivElement>(null);
|
const widgetRef = useRef<HTMLDivElement>(null);
|
||||||
const viewType = useNoteViewType(note);
|
const viewType = useNoteViewType(note);
|
||||||
const noteIds = useNoteIds(note, viewType, ntxId);
|
const noteIds = useNoteIds(note, viewType, ntxId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user