feat: react zitadel
This commit is contained in:
@@ -1,36 +1,30 @@
|
||||
import { createRootRoute, createRoute, Outlet } from "@tanstack/react-router";
|
||||
import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
|
||||
import { createRootRoute, createRoute } from "@tanstack/react-router";
|
||||
|
||||
import { CreateAccountView } from "./views/account/create.view.tsx";
|
||||
import { TodosView } from "./views/todo/todos.view.tsx";
|
||||
import { AppView } from "./views/app.view.tsx";
|
||||
import { CallbackView } from "./views/auth/callback.view.tsx";
|
||||
import { DashboardView } from "./views/dashboard/dashboard.view.tsx";
|
||||
|
||||
const rootRoute = createRootRoute({
|
||||
component: () => (
|
||||
<>
|
||||
<Outlet />
|
||||
<TanStackRouterDevtools />
|
||||
</>
|
||||
),
|
||||
const root = createRootRoute();
|
||||
|
||||
const callback = createRoute({
|
||||
getParentRoute: () => root,
|
||||
path: "/callback",
|
||||
component: CallbackView,
|
||||
});
|
||||
|
||||
const homeRoute = createRoute({
|
||||
getParentRoute: () => rootRoute,
|
||||
const app = createRoute({
|
||||
id: "app",
|
||||
getParentRoute: () => root,
|
||||
component: AppView,
|
||||
});
|
||||
|
||||
const dashboard = createRoute({
|
||||
getParentRoute: () => app,
|
||||
path: "/",
|
||||
component: function Index() {
|
||||
return <h3>Welcome Home!</h3>;
|
||||
},
|
||||
component: DashboardView,
|
||||
});
|
||||
|
||||
const createAccountRoute = createRoute({
|
||||
getParentRoute: () => rootRoute,
|
||||
path: "/accounts",
|
||||
component: CreateAccountView,
|
||||
});
|
||||
root.addChildren([app, callback]);
|
||||
app.addChildren([dashboard]);
|
||||
|
||||
const todosRoute = createRoute({
|
||||
getParentRoute: () => rootRoute,
|
||||
path: "/todos",
|
||||
component: TodosView,
|
||||
});
|
||||
|
||||
export const routeTree = rootRoute.addChildren([homeRoute, createAccountRoute, todosRoute]);
|
||||
export const routeTree = root;
|
||||
|
||||
Reference in New Issue
Block a user