diff --git a/apps/client/src/widgets/launch_bar/CalendarWidget.tsx b/apps/client/src/widgets/launch_bar/CalendarWidget.tsx index 6dfa7c3b0..959294228 100644 --- a/apps/client/src/widgets/launch_bar/CalendarWidget.tsx +++ b/apps/client/src/widgets/launch_bar/CalendarWidget.tsx @@ -1,6 +1,6 @@ import { Dispatch, StateUpdater, useEffect, useMemo, useRef, useState } from "preact/hooks"; import FNote from "../../entities/fnote"; -import { LaunchBarDropdownButton, useLauncherIconAndTitle } from "./launch_bar_widgets"; +import { LaunchBarDropdownButton, LauncherNoteProps, useLauncherIconAndTitle } from "./launch_bar_widgets"; import { Dayjs, dayjs } from "@triliumnext/commons"; import appContext from "../../components/app_context"; import "./CalendarWidget.css"; @@ -30,7 +30,7 @@ const MONTHS = [ t("calendar.december") ]; -export default function CalendarWidget({ launcherNote }: { launcherNote: FNote }) { +export default function CalendarWidget({ launcherNote }: LauncherNoteProps) { const { title, icon } = useLauncherIconAndTitle(launcherNote); const [ calendarArgs, setCalendarArgs ] = useState>(); const [ date, setDate ] = useState(); diff --git a/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx b/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx index 040d9dd23..2d399ff8c 100644 --- a/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx +++ b/apps/client/src/widgets/launch_bar/LauncherDefinitions.tsx @@ -7,12 +7,12 @@ import QuickSearchWidget from "../quick_search"; import { isMobile } from "../../services/utils"; import date_notes from "../../services/date_notes"; import { CustomNoteLauncher } from "./GenericButtons"; -import { LaunchBarActionButton, LaunchBarContext, useLauncherIconAndTitle } from "./launch_bar_widgets"; +import { LaunchBarActionButton, LaunchBarContext, LauncherNoteProps, useLauncherIconAndTitle } from "./launch_bar_widgets"; import dialog from "../../services/dialog"; import { t } from "../../services/i18n"; import { CommandNames } from "../../components/app_context"; -export function CommandButton({ launcherNote }: { launcherNote: FNote }) { +export function CommandButton({ launcherNote }: LauncherNoteProps) { const { icon, title } = useLauncherIconAndTitle(launcherNote); const [ command ] = useNoteLabel(launcherNote, "command"); @@ -50,7 +50,7 @@ export function NoteLauncher({ launcherNote, ...restProps }: { launcherNote: FNo ); } -export function ScriptLauncher({ launcherNote }: { launcherNote: FNote }) { +export function ScriptLauncher({ launcherNote }: LauncherNoteProps) { const { icon, title } = useLauncherIconAndTitle(launcherNote); return ( (); const parentComponent = useContext(ParentComponent) as BasicWidget | null; diff --git a/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx b/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx index f8dbf2504..e3f219c93 100644 --- a/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx +++ b/apps/client/src/widgets/launch_bar/launch_bar_widgets.tsx @@ -13,6 +13,11 @@ export const LaunchBarContext = createContext<{ isHorizontalLayout: false }) +export interface LauncherNoteProps { + /** The corresponding {@link FNote} of type {@code launcher} in the hidden subtree of this launcher. Generally this launcher note holds information about the launcher via labels and relations, but also the title and the icon of the launcher. Not to be confused with the target note, which is specific to some launchers. */ + launcherNote: FNote; +} + export function LaunchBarActionButton(props: Omit) { const { isHorizontalLayout } = useContext(LaunchBarContext);