diff --git a/src/app/page.tsx b/src/app/page.tsx
index 5fb1c82..de9e337 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -5,37 +5,41 @@ import HomeText from "@/components/texts/home.mdx"
import Link from "@/components/link";
import { FakeWindow, HomeWindows } from "@/components/windows";
-import { WindowManagerProvider } from "@/hooks/window-manager";
import { SnowfallBackground } from "@/components/events/christmas";
+import { WindowManagerProvider } from "@/hooks/window-manager";
+import { ThemeEventsProvider } from "@/hooks/theme-events";
+
export default function Home() {
return (<>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
>);
}
diff --git a/src/components/client-windows.tsx b/src/components/client-windows.tsx
index 06c23f6..170332a 100644
--- a/src/components/client-windows.tsx
+++ b/src/components/client-windows.tsx
@@ -67,11 +67,9 @@ export const FakeRelativeWindow = ({
}
useEffect(() => {
- if (!windowManager.isLocalDataExists) {
- if (!currentWindow) populateWindow();
- return () => {
- windowManager.remove(windowName);
- }
+ populateWindow();
+ return () => {
+ windowManager.remove(windowName);
}
}, []);
diff --git a/src/components/events/christmas.tsx b/src/components/events/christmas.tsx
index 0e43548..ead5800 100644
--- a/src/components/events/christmas.tsx
+++ b/src/components/events/christmas.tsx
@@ -1,5 +1,6 @@
'use client'
+import { useThemeEvents } from '@/hooks/theme-events';
import { getEvent } from '@/lib/utils';
import clsx from 'clsx';
import NextImage from 'next/image';
@@ -28,9 +29,9 @@ interface ChristmasProps {
}
export const ChristmasExclusive = ({ children }: { children: ReactNode }) => {
- const isItChristmas = getEvent()?.name == 'christmas';
+ const eventNow = useThemeEvents()?.event;
- if (isItChristmas) return children;
+ if (eventNow?.name == 'christmas') return children;
return null;
}
diff --git a/src/components/windows.tsx b/src/components/windows.tsx
index e3cfcc3..3577545 100644
--- a/src/components/windows.tsx
+++ b/src/components/windows.tsx
@@ -84,7 +84,7 @@ export const HomeWindows = () => (
@@ -98,7 +98,7 @@ export const HomeWindows = () => (
/>
diff --git a/src/hooks/theme-events.tsx b/src/hooks/theme-events.tsx
new file mode 100644
index 0000000..e04f0c9
--- /dev/null
+++ b/src/hooks/theme-events.tsx
@@ -0,0 +1,21 @@
+'use client'
+
+import { EventsDate } from "@/lib/types";
+import { getEvent } from "@/lib/utils";
+import { createContext, useContext } from "react";
+
+interface ThemeEventsContextType {
+ event: EventsDate | undefined
+}
+
+const ThemeEventsContext = createContext(undefined);
+
+export const ThemeEventsProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {
+ const eventNow = getEvent();
+
+ return
+ {children}
+
+}
+
+export const useThemeEvents = () => useContext(ThemeEventsContext);
\ No newline at end of file