Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(react/collections): use normal buttons for calendar prev/next
Elian Doran05299952a9e2
diff --git a/apps/client/src/widgets/collections/calendar/index.tsx b/apps/client/src/widgets/collections/calendar/index.tsxindex 306b866891..acae174e57 100644--- a/apps/client/src/widgets/collections/calendar/index.tsx+++ b/apps/client/src/widgets/collections/calendar/index.tsx@@ -340,18 +340,13 @@ function CalendarTouchBar({ calendarRef }: { calendarRef: RefObject<FullCalendarlabel={t("calendar.today")}click={() => calendarRef.current?.today()}/>- <TouchBarSegmentedControl- mode="buttons"- segments={[- {- icon: "NSImageNameTouchBarGoBackTemplate",- onClick: () => calendarRef.current?.prev()- },- {- icon: "NSImageNameTouchBarGoForwardTemplate",- onClick: () => calendarRef.current?.next()- }- ]}+ <TouchBarButton+ icon="NSImageNameTouchBarGoBackTemplate"+ click={() => calendarRef.current?.prev()}+ />+ <TouchBarButton+ icon="NSImageNameTouchBarGoForwardTemplate"+ click={() => calendarRef.current?.next()}/></TouchBar>);diff --git a/apps/client/src/widgets/react/TouchBar.tsx b/apps/client/src/widgets/react/TouchBar.tsxindex 42b6c2da95..c16e8a74f7 100644--- a/apps/client/src/widgets/react/TouchBar.tsx+++ b/apps/client/src/widgets/react/TouchBar.tsx@@ -21,7 +21,8 @@ interface SliderProps {}interface ButtonProps {- label: string;+ label?: string;+ icon?: string;click: () => void;enabled?: boolean;}@@ -122,12 +123,13 @@ export function TouchBarSlider({ label, value, minValue, maxValue, onChange }: Sreturn <></>;}-export function TouchBarButton({ label, click, enabled }: ButtonProps) {+export function TouchBarButton({ label, icon, click, enabled }: ButtonProps) {const api = useContext(TouchBarContext);if (api) {const item = new api.TouchBar.TouchBarButton({- label, click, enabled+ label, click, enabled,+ icon: icon ? buildIcon(api.nativeImage, icon) : undefined});api.addItem(item);}