add dark theme toggle
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user