add dark theme toggle

This commit is contained in:
2026-03-02 13:00:30 +01:00
parent 9d5ea49d85
commit de0be12aab
10 changed files with 125 additions and 24 deletions

View File

@@ -5,6 +5,7 @@ import type { FlutterEvent, FlutterTimelineState } from "@/lib/flutter-bridge";
import { timelineQueryOptions } from "@/functions/get-timeline";
import { FlutterView } from "@/components/flutter-view";
import { useEntryMovedMutation } from "@/hooks/use-entry-moved-mutation";
import { useTheme } from "@/lib/theme";
export const Route = createFileRoute("/timeline/$timelineId")({
loader: async ({ context, params }) => {
@@ -21,6 +22,7 @@ function RouteComponent() {
const [selectedItemId, setSelectedItemId] = useState<string | null>(null);
const [flutterHeight, setFlutterHeight] = useState<number | undefined>();
const entryMoved = useEntryMovedMutation(timelineId);
const { theme } = useTheme();
const flutterState: FlutterTimelineState = useMemo(
() => ({
@@ -42,8 +44,9 @@ function RouteComponent() {
),
groupOrder: timeline.groupOrder,
selectedItemId,
darkMode: theme === "dark",
}),
[timeline, selectedItemId]
[timeline, selectedItemId, theme]
);
const handleEvent = useCallback(