diff --git a/web/src/layout/AdminLayout.tsx b/web/src/layout/AdminLayout.tsx
new file mode 100644
index 0000000..ba3af1b
--- /dev/null
+++ b/web/src/layout/AdminLayout.tsx
@@ -0,0 +1,42 @@
+import { useAuth } from "@/store/auth";
+import type { FC } from "react";
+import { Navigate, Outlet } from "react-router";
+
+const AdminLayout: FC = () => {
+ const profile = useAuth((state) => state.profile);
+
+ if (!profile) {
+
;
+ }
+
+ if (!profile?.isAdmin) {
+ return
;
+ }
+
+ return
;
+};
+
+export default AdminLayout;
diff --git a/web/src/layout/AuthLayout.tsx b/web/src/layout/AuthLayout.tsx
index af3f3b8..812f766 100644
--- a/web/src/layout/AuthLayout.tsx
+++ b/web/src/layout/AuthLayout.tsx
@@ -45,8 +45,7 @@ const AuthLayout = () => {
const navigate = useNavigate();
const isAuthPage = useMemo(() => {
- const allowedPaths = ["/login", "/register", "/authenticate"];
- return allowedPaths.some((p) => location.pathname.startsWith(p));
+ return location.pathname.startsWith("/auth");
}, [location.pathname]);
const loading = useMemo(() => {
@@ -116,7 +115,7 @@ const AuthLayout = () => {
if (signInRequired && !isAuthPage) {
return (
);
diff --git a/web/src/layout/DashboardLayout.tsx b/web/src/layout/DashboardLayout.tsx
new file mode 100644
index 0000000..407af96
--- /dev/null
+++ b/web/src/layout/DashboardLayout.tsx
@@ -0,0 +1,41 @@
+import Sidebar from "@/components/Home/Sidebar";
+import TopBar from "@/components/Home/TopBar";
+import { Card, CardContent } from "@/components/ui/card";
+import { type FC } from "react";
+import { Outlet } from "react-router";
+
+const DashboardLayout: FC = () => {
+ return (
+
+
+
+
+

+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default DashboardLayout;
diff --git a/web/src/components/Home/Tabs/ApiServices.tsx b/web/src/pages/ApiServices/index.tsx
similarity index 98%
rename from web/src/components/Home/Tabs/ApiServices.tsx
rename to web/src/pages/ApiServices/index.tsx
index 2df600e..6260e55 100644
--- a/web/src/components/Home/Tabs/ApiServices.tsx
+++ b/web/src/pages/ApiServices/index.tsx
@@ -36,7 +36,7 @@ const services = [
},
];
-const ApiServices: FC = () => {
+const ApiServicesPage: FC = () => {
return (
@@ -101,4 +101,4 @@ const ApiServices: FC = () => {
);
};
-export default ApiServices;
+export default ApiServicesPage;
diff --git a/web/src/pages/Index/index.tsx b/web/src/pages/Index/index.tsx
index c90d9e7..9517c4c 100644
--- a/web/src/pages/Index/index.tsx
+++ b/web/src/pages/Index/index.tsx
@@ -1,51 +1,31 @@
-import { useState, type FC } from "react";
+import { Button } from "@/components/ui/button";
+import Avatar from "@/feature/Avatar";
+import { useAuth } from "@/store/auth";
+import { type FC } from "react";
// import overlay from "@/assets/overlay.jpg";
// import darkOverlay from "@/assets/dark-overlay.jpg";
-import { Card, CardContent } from "@/components/ui/card";
-import Sidebar from "@/components/Home/Sidebar";
-import TopBar from "@/components/Home/TopBar";
-import Home from "@/components/Home/Tabs/Home";
-import PersonalInfo from "@/components/Home/Tabs/PersonalInfo";
-import ApiServices from "@/components/Home/Tabs/ApiServices";
-
const IndexPage: FC = () => {
- const [tab, setTab] = useState("home");
+ const profile = useAuth((state) => state.profile);
+ const signOut = useAuth((state) => state.signOut);
return (
-
-
-
-
-

+
+
+
+ Welcome, {profile?.full_name}
+
+
+ Manage your info, private and security to make Home Guard work better
+ for you.
+
-
-
-
- {/*
*/}
-
-
-
setTab(tab)} />
-
-
-
setTab(tab)} />
- {tab === "home" && }
- {/* {tab === "personal-info" && } */}
-
-
- {tab === "personal-info" &&
}
- {tab === "api-services" &&
}
-
-
-
-
-
-
+
);
};
diff --git a/web/src/pages/Login/index.tsx b/web/src/pages/Login/index.tsx
index 2123397..d29596d 100644
--- a/web/src/pages/Login/index.tsx
+++ b/web/src/pages/Login/index.tsx
@@ -161,7 +161,7 @@ export default function LoginPage() {
Don't have an account?{" "}
diff --git a/web/src/components/Home/Tabs/PersonalInfo.tsx b/web/src/pages/PersonalInfo/index.tsx
similarity index 95%
rename from web/src/components/Home/Tabs/PersonalInfo.tsx
rename to web/src/pages/PersonalInfo/index.tsx
index 82456d2..c33b191 100644
--- a/web/src/components/Home/Tabs/PersonalInfo.tsx
+++ b/web/src/pages/PersonalInfo/index.tsx
@@ -1,9 +1,9 @@
import Avatar from "@/feature/Avatar";
import { useAuth } from "@/store/auth";
import { ChevronRight } from "lucide-react";
-import { type FC } from "react";
+import type { FC } from "react";
-const PersonalInfo: FC = () => {
+const PersonalInfoPage: FC = () => {
const profile = useAuth((state) => state.profile);
return (
@@ -65,4 +65,4 @@ const PersonalInfo: FC = () => {
);
};
-export default PersonalInfo;
+export default PersonalInfoPage;
diff --git a/web/src/pages/Register/index.tsx b/web/src/pages/Register/index.tsx
index 67a81d5..3f32852 100644
--- a/web/src/pages/Register/index.tsx
+++ b/web/src/pages/Register/index.tsx
@@ -239,7 +239,7 @@ export default function RegisterPage() {
Already have an account?{" "}