diff --git a/src/app.tsx b/src/app.tsx
index 3acc904..cdcac73 100644
--- a/src/app.tsx
+++ b/src/app.tsx
@@ -1,8 +1,8 @@
import { FunctionComponent } from "preact";
-import { ErrorBoundary, LocationProvider, Route, Router, useLocation } from "preact-iso";
+import { ErrorBoundary, lazy, LocationProvider, Route, Router, useLocation } from "preact-iso";
import "preact/debug";
import LoginPage from "./pages/login";
-import ProfilePage from "./pages/profile";
+import { AppProvider } from "./providers/AuthProvider";
const HomePage: FunctionComponent = () => {
const location = useLocation();
@@ -12,14 +12,17 @@ const HomePage: FunctionComponent = () => {
export function App() {
return (
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ import("./pages/profile"))} />
+ 404
} />
+
+
+
+
);
}
diff --git a/src/components/layout.tsx b/src/components/layout.tsx
deleted file mode 100644
index ad94bd4..0000000
--- a/src/components/layout.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { FunctionComponent } from "preact";
-import Menu from "./menu";
-
-const Layout: FunctionComponent = (props) => {
- return (
-
- {props.children}
-
-
- );
-};
-
-export default Layout;
diff --git a/src/pages/login.tsx b/src/pages/login.tsx
index a684268..736562e 100644
--- a/src/pages/login.tsx
+++ b/src/pages/login.tsx
@@ -1,14 +1,25 @@
import Button from "@/components/ui/Button";
import Input from "@/components/ui/Input";
+import { useAppContext } from "@/providers/AuthProvider";
import { FunctionComponent } from "preact";
+import { useLocation } from "preact-iso";
import classes from "./login.module.scss";
const LoginPage: FunctionComponent = () => {
+ const { isLoggedIn } = useAppContext();
+ const location = useLocation();
return (
);
diff --git a/src/pages/profile.tsx b/src/pages/profile.tsx
index a786293..d172c39 100644
--- a/src/pages/profile.tsx
+++ b/src/pages/profile.tsx
@@ -1,11 +1,26 @@
-import Layout from "@/components/layout";
+import Menu from "@/components/menu";
import { FunctionComponent } from "preact";
+import { Route, Router, useLocation } from "preact-iso";
const ProfilePage: FunctionComponent = () => {
+ const { route } = useLocation();
return (
-
- Profile
-
+
+
+
+ Test
} />
+ Test2
} />
+ {
+ route("/profile/settings", true);
+ return null;
+ }}
+ />
+
+
+
+
);
};