diff --git a/pkg/views/src/main.tsx b/pkg/views/src/main.tsx
index e65d710..0ded012 100644
--- a/pkg/views/src/main.tsx
+++ b/pkg/views/src/main.tsx
@@ -13,17 +13,9 @@ import "@unocss/reset/tailwind.css";
import "@fontsource/roboto/latin.css";
import AppShell from "@/components/AppShell.tsx";
-import LandingPage from "@/pages/landing.tsx";
-import SignUpPage from "@/pages/auth/sign-up.tsx";
-import SignInPage from "@/pages/auth/sign-in.tsx";
-import OauthConnectPage from "@/pages/auth/connect.tsx";
-import DashboardPage from "@/pages/users/dashboard.tsx";
import ErrorBoundary from "@/error.tsx";
import AppLoader from "@/components/AppLoader.tsx";
import UserLayout from "@/pages/users/layout.tsx";
-import NotificationsPage from "@/pages/users/notifications.tsx";
-import PersonalizePage from "@/pages/users/personalize.tsx";
-import SecurityPage from "@/pages/users/security.tsx";
import { UserinfoProvider } from "@/stores/userinfo.tsx";
import { WellKnownProvider } from "@/stores/wellKnown.tsx";
import AuthLayout from "@/pages/auth/layout.tsx";
@@ -46,7 +38,7 @@ const router = createBrowserRouter([
element: ,
errorElement: ,
children: [
- { path: "/", element: },
+ { path: "/", lazy: () => import("@/pages/landing.tsx") },
{
path: "/",
element: ,
@@ -55,10 +47,10 @@ const router = createBrowserRouter([
path: "/users",
element: ,
children: [
- { path: "/users", element: },
- { path: "/users/notifications", element: },
- { path: "/users/personalize", element: },
- { path: "/users/security", element: }
+ { path: "/users", lazy: () => import("@/pages/users/dashboard.tsx") },
+ { path: "/users/notifications", lazy: () => import("@/pages/users/notifications.tsx") },
+ { path: "/users/personalize", lazy: () => import("@/pages/users/personalize.tsx") },
+ { path: "/users/security", lazy: () => import("@/pages/users/security.tsx") }
]
}
]
@@ -70,9 +62,9 @@ const router = createBrowserRouter([
element: ,
errorElement: ,
children: [
- { path: "/auth/sign-up", element: , errorElement: },
- { path: "/auth/sign-in", element: , errorElement: },
- { path: "/auth/o/connect", element: , errorElement: }
+ { path: "/auth/sign-up", errorElement: , lazy: () => import("@/pages/auth/sign-up.tsx") },
+ { path: "/auth/sign-in", errorElement: , lazy: () => import("@/pages/auth/sign-in.tsx") },
+ { path: "/auth/o/connect", errorElement: , lazy: () => import("@/pages/auth/connect.tsx") }
]
}
]);
diff --git a/pkg/views/src/pages/auth/connect.tsx b/pkg/views/src/pages/auth/connect.tsx
index 567a3ed..ce69c4e 100644
--- a/pkg/views/src/pages/auth/connect.tsx
+++ b/pkg/views/src/pages/auth/connect.tsx
@@ -17,7 +17,7 @@ import { useSearchParams } from "react-router-dom";
import OutletIcon from "@mui/icons-material/Outlet";
import WhatshotIcon from "@mui/icons-material/Whatshot";
-export default function OauthConnectPage() {
+export function Component() {
const { getAtk } = useUserinfo();
const [panel, setPanel] = useState(0);
diff --git a/pkg/views/src/pages/auth/sign-in.tsx b/pkg/views/src/pages/auth/sign-in.tsx
index 22a62a7..6c43587 100644
--- a/pkg/views/src/pages/auth/sign-in.tsx
+++ b/pkg/views/src/pages/auth/sign-in.tsx
@@ -25,7 +25,7 @@ import KeyIcon from "@mui/icons-material/Key";
import PasswordIcon from "@mui/icons-material/Password";
import EmailIcon from "@mui/icons-material/Email";
-export default function SignInPage() {
+export function Component() {
const [panel, setPanel] = useState(0);
const [error, setError] = useState(null);
diff --git a/pkg/views/src/pages/auth/sign-up.tsx b/pkg/views/src/pages/auth/sign-up.tsx
index 0af8031..b57f5d1 100644
--- a/pkg/views/src/pages/auth/sign-up.tsx
+++ b/pkg/views/src/pages/auth/sign-up.tsx
@@ -21,7 +21,7 @@ import { FormEvent, useState } from "react";
import { request } from "@/scripts/request.ts";
import { useWellKnown } from "@/stores/wellKnown.tsx";
-export default function SignUpPage() {
+export function Component() {
const [done, setDone] = useState(false);
const [error, setError] = useState(null);
diff --git a/pkg/views/src/pages/landing.tsx b/pkg/views/src/pages/landing.tsx
index 837bf8e..1d4d998 100644
--- a/pkg/views/src/pages/landing.tsx
+++ b/pkg/views/src/pages/landing.tsx
@@ -1,7 +1,7 @@
import { Button, Container, Grid, Typography } from "@mui/material";
import { Link as RouterLink } from "react-router-dom";
-export default function LandingPage() {
+export function Component() {
return (
diff --git a/pkg/views/src/pages/users/dashboard.tsx b/pkg/views/src/pages/users/dashboard.tsx
index f0e1dc6..8bae9a4 100644
--- a/pkg/views/src/pages/users/dashboard.tsx
+++ b/pkg/views/src/pages/users/dashboard.tsx
@@ -1,7 +1,7 @@
import { Alert, Box, Card, CardContent, Container, Typography } from "@mui/material";
import { useUserinfo } from "@/stores/userinfo.tsx";
-export default function DashboardPage() {
+export function Component() {
const { userinfo } = useUserinfo();
return (
diff --git a/pkg/views/src/pages/users/notifications.tsx b/pkg/views/src/pages/users/notifications.tsx
index 16fafe0..95814da 100644
--- a/pkg/views/src/pages/users/notifications.tsx
+++ b/pkg/views/src/pages/users/notifications.tsx
@@ -5,7 +5,7 @@ import { useEffect, useState } from "react";
import { TransitionGroup } from "react-transition-group";
import MarkEmailReadIcon from "@mui/icons-material/MarkEmailRead";
-export default function NotificationsPage() {
+export function Component() {
const { userinfo, readProfiles, getAtk } = useUserinfo();
const [loading, setLoading] = useState(true);
diff --git a/pkg/views/src/pages/users/personalize.tsx b/pkg/views/src/pages/users/personalize.tsx
index a024259..fa9f02a 100644
--- a/pkg/views/src/pages/users/personalize.tsx
+++ b/pkg/views/src/pages/users/personalize.tsx
@@ -37,7 +37,7 @@ const VisuallyHiddenInput = styled("input")({
width: 1
});
-export default function PersonalizePage() {
+export function Component() {
const { userinfo, readProfiles, getAtk } = useUserinfo();
const [done, setDone] = useState(false);
diff --git a/pkg/views/src/pages/users/security.tsx b/pkg/views/src/pages/users/security.tsx
index 166edc0..f978590 100644
--- a/pkg/views/src/pages/users/security.tsx
+++ b/pkg/views/src/pages/users/security.tsx
@@ -19,7 +19,7 @@ import { request } from "@/scripts/request.ts";
import ExitToAppIcon from "@mui/icons-material/ExitToApp";
-export default function SecurityPage() {
+export function Component() {
const dataDefinitions: { [id: string]: GridColDef[] } = {
challenges: [
{ field: "id", headerName: "ID", width: 64 },