diff --git a/apps/client/src/print.tsx b/apps/client/src/print.tsx index a29b73830..5db1ebe75 100644 --- a/apps/client/src/print.tsx +++ b/apps/client/src/print.tsx @@ -1,6 +1,6 @@ import FNote from "./entities/fnote"; import { render } from "preact"; -import { CustomNoteList } from "./widgets/collections/NoteList"; +import { CustomNoteList, useNoteViewType } from "./widgets/collections/NoteList"; import { useCallback, useLayoutEffect, useRef } from "preact/hooks"; import content_renderer from "./services/content_renderer"; @@ -85,7 +85,9 @@ function SingleNoteRenderer({ note, onReady }: RendererProps) { } function CollectionRenderer({ note, onReady }: RendererProps) { + const viewType = useNoteViewType(note); return void; } -export default function NoteList(props: Pick) { +export default function NoteList(props: Pick) { const { note, noteContext, notePath, ntxId } = useNoteContext(); const viewType = useNoteViewType(note); const [ enabled, setEnabled ] = useState(noteContext?.hasNoteList()); @@ -37,12 +37,12 @@ export default function NoteList(props: Pick } -export function SearchNoteList(props: Omit) { +export function SearchNoteList(props: Omit) { const viewType = useNoteViewType(props.note); return } -export function CustomNoteList({ note, viewType, isEnabled: shouldEnable, notePath, highlightedTokens, displayOnlyCollections, ntxId, onReady, ...restProps }: NoteListProps) { +export function CustomNoteList({ note, viewType, isEnabled: shouldEnable, notePath, highlightedTokens, displayOnlyCollections, ntxId, onReady, ...restProps }: NoteListProps) { const widgetRef = useRef(null); const noteIds = useNoteIds(shouldEnable ? note : null, viewType, ntxId); const isFullHeight = (viewType && viewType !== "list" && viewType !== "grid"); @@ -119,7 +119,7 @@ function getComponentByViewType(viewType: ViewTypeOptions, props: ViewModeProps< } } -function useNoteViewType(note?: FNote | null): ViewTypeOptions | undefined { +export function useNoteViewType(note?: FNote | null): ViewTypeOptions | undefined { const [ viewType ] = useNoteLabel(note, "viewType"); if (!note) {