diff --git a/src/Router.tsx b/src/Router.tsx
index cd6ae27..eee1585 100644
--- a/src/Router.tsx
+++ b/src/Router.tsx
@@ -1,33 +1,21 @@
import { BrowserRouter, Route, Routes } from "react-router-dom";
-import { GiftForm } from "./GiftForm";
-import { Page } from "./components/RouterPage";
+import { GiftPage } from "./pages/GiftPage";
+import { Page } from "./pages/Page";
export function Router() {
return (
- (
-
- )}
- />
- }
- />
+ } />
TODO
} />} />
(
-
- )}
- />
+
}
/>
+ 404
} />
);
diff --git a/src/ArDriveLogo.tsx b/src/components/ArDriveLogo.tsx
similarity index 99%
rename from src/ArDriveLogo.tsx
rename to src/components/ArDriveLogo.tsx
index b79a72d..4fb09f5 100644
--- a/src/ArDriveLogo.tsx
+++ b/src/components/ArDriveLogo.tsx
@@ -1,25 +1,7 @@
-import { JSX, useEffect, useState } from "react";
+import { useIsDarkMode } from "../hooks/useIsDarkMode";
-export function ArDriveLogo(): JSX.Element {
- const [isDarkMode, setIsDarkMode] = useState(() => {
- // Check the current theme using matchMedia
- return window.matchMedia("(prefers-color-scheme: dark)").matches;
- });
-
- useEffect(() => {
- // Update the theme on changes
- const mediaQueryList = window.matchMedia("(prefers-color-scheme: dark)");
- const handleChange = (e: MediaQueryListEvent) => {
- setIsDarkMode(e.matches);
- };
-
- mediaQueryList.addEventListener("change", handleChange);
-
- // Cleanup event listener on component unmount
- return () => {
- mediaQueryList.removeEventListener("change", handleChange);
- };
- }, []);
+export function ArDriveLogo() {
+ const isDarkMode = useIsDarkMode();
return (
@@ -28,7 +10,7 @@ export function ArDriveLogo(): JSX.Element {
);
}
-function ArDriveLogoLight(): JSX.Element {
+function ArDriveLogoLight() {
return (