Skip to content

Commit 61d8ee1

Browse files
author
Rajat Saxena
committed
Fixed dark mode detection
1 parent f1c4e31 commit 61d8ee1

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

apps/web/components/public/base-layout/template/widget-by-name.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
import React from "react";
2-
import widgets from "../../../../ui-config/widgets";
3-
import type { AppState, AppDispatch } from "@courselit/state-management";
4-
import { COMPONENT_MISSING_SUFFIX } from "../../../../ui-config/strings";
5-
import WidgetErrorBoundary from "./widget-error-boundary";
2+
import widgets from "@/ui-config/widgets";
3+
import { COMPONENT_MISSING_SUFFIX } from "@/ui-config/strings";
4+
import WidgetErrorBoundary from "@/components/public/base-layout/template/widget-error-boundary";
65
import { useTheme } from "next-themes";
76
import { WidgetDefaultSettings, WidgetProps } from "@courselit/common-models";
87

9-
interface WidgetByNameProps {
10-
id: string;
11-
name: string;
12-
state: Partial<AppState>;
13-
dispatch?: AppDispatch;
14-
settings: Record<string, unknown>;
15-
pageData: Record<string, unknown>;
16-
editing: boolean;
17-
}
18-
198
const WidgetByName = ({
209
id,
2110
name,
@@ -25,7 +14,7 @@ const WidgetByName = ({
2514
pageData,
2615
editing = false,
2716
}: Omit<WidgetProps<WidgetDefaultSettings>, "toggleTheme" | "nextTheme">) => {
28-
const { theme: nextTheme, setTheme: setNextTheme } = useTheme();
17+
const { resolvedTheme: nextTheme, setTheme: setNextTheme } = useTheme();
2918

3019
const toggleTheme = () => {
3120
const themeNext = nextTheme === "dark" ? "light" : "dark";

0 commit comments

Comments
 (0)