Skip to content

Commit

Permalink
Update default route layout
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans committed Nov 20, 2024
1 parent abad9e1 commit 0580257
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 21 deletions.
60 changes: 43 additions & 17 deletions web/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import { Route as MailIndexImport } from './routes/$mail/index'
import { Route as LoginLayoutImport } from './routes/login/_layout'
import { Route as ConfigureLayoutImport } from './routes/configure/_layout'
import { Route as LoginLayoutIndexImport } from './routes/login/_layout.index'
import { Route as ConfigureInstanceIndexImport } from './routes/configure/instance/index'
import { Route as ConfigureLayoutIndexImport } from './routes/configure/_layout.index'
import { Route as ConfigureLayoutInstanceIndexImport } from './routes/configure/_layout.instance/index'

// Create Virtual Routes

Expand Down Expand Up @@ -69,9 +70,9 @@ const LoginLayoutIndexRoute = LoginLayoutIndexImport.update({
getParentRoute: () => LoginLayoutRoute,
} as any)

const ConfigureInstanceIndexRoute = ConfigureInstanceIndexImport.update({
path: '/instance/',
getParentRoute: () => ConfigureRoute,
const ConfigureLayoutIndexRoute = ConfigureLayoutIndexImport.update({
path: '/',
getParentRoute: () => ConfigureLayoutRoute,
} as any)

const LoginLayoutCreateLazyRoute = LoginLayoutCreateLazyImport.update({
Expand All @@ -81,6 +82,12 @@ const LoginLayoutCreateLazyRoute = LoginLayoutCreateLazyImport.update({
import('./routes/login/_layout.create.lazy').then((d) => d.Route),
)

const ConfigureLayoutInstanceIndexRoute =
ConfigureLayoutInstanceIndexImport.update({
path: '/instance/',
getParentRoute: () => ConfigureLayoutRoute,
} as any)

// Populate the FileRoutesByPath interface

declare module '@tanstack/react-router' {
Expand Down Expand Up @@ -141,12 +148,12 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LoginLayoutCreateLazyImport
parentRoute: typeof LoginLayoutImport
}
'/configure/instance/': {
id: '/configure/instance/'
path: '/instance'
fullPath: '/configure/instance'
preLoaderRoute: typeof ConfigureInstanceIndexImport
parentRoute: typeof ConfigureImport
'/configure/_layout/': {
id: '/configure/_layout/'
path: '/'
fullPath: '/configure/'
preLoaderRoute: typeof ConfigureLayoutIndexImport
parentRoute: typeof ConfigureLayoutImport
}
'/login/_layout/': {
id: '/login/_layout/'
Expand All @@ -155,6 +162,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LoginLayoutIndexImport
parentRoute: typeof LoginLayoutImport
}
'/configure/_layout/instance/': {
id: '/configure/_layout/instance/'
path: '/instance'
fullPath: '/configure/instance'
preLoaderRoute: typeof ConfigureLayoutInstanceIndexImport
parentRoute: typeof ConfigureLayoutImport
}
}
}

Expand All @@ -163,7 +177,12 @@ declare module '@tanstack/react-router' {
export const routeTree = rootRoute.addChildren({
IndexLazyRoute,
DebugLazyRoute,
ConfigureRoute: ConfigureRoute.addChildren({ ConfigureInstanceIndexRoute }),
ConfigureRoute: ConfigureRoute.addChildren({
ConfigureLayoutRoute: ConfigureLayoutRoute.addChildren({
ConfigureLayoutIndexRoute,
ConfigureLayoutInstanceIndexRoute,
}),
}),
LoginRoute: LoginRoute.addChildren({
LoginLayoutRoute: LoginLayoutRoute.addChildren({
LoginLayoutCreateLazyRoute,
Expand Down Expand Up @@ -197,13 +216,16 @@ export const routeTree = rootRoute.addChildren({
"/configure": {
"filePath": "configure",
"children": [
"/configure/_layout",
"/configure/instance/"
"/configure/_layout"
]
},
"/configure/_layout": {
"filePath": "configure/_layout.tsx",
"parent": "/configure"
"parent": "/configure",
"children": [
"/configure/_layout/",
"/configure/_layout/instance/"
]
},
"/login": {
"filePath": "login",
Expand All @@ -226,13 +248,17 @@ export const routeTree = rootRoute.addChildren({
"filePath": "login/_layout.create.lazy.tsx",
"parent": "/login/_layout"
},
"/configure/instance/": {
"filePath": "configure/instance/index.tsx",
"parent": "/configure"
"/configure/_layout/": {
"filePath": "configure/_layout.index.tsx",
"parent": "/configure/_layout"
},
"/login/_layout/": {
"filePath": "login/_layout.index.tsx",
"parent": "/login/_layout"
},
"/configure/_layout/instance/": {
"filePath": "configure/_layout.instance/index.tsx",
"parent": "/configure/_layout"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions web/src/routes/configure/_layout.index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { createFileRoute } from '@tanstack/react-router';

export const Route = createFileRoute('/configure/_layout/')({
component: () => <div>Hello /configure/!</div>,
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createFileRoute } from '@tanstack/react-router';

export const Route = createFileRoute('/configure/instance/')({
export const Route = createFileRoute('/configure/_layout/instance/')({
component: () => <div>Hello /configure/instance/!</div>,
});
12 changes: 9 additions & 3 deletions web/src/routes/configure/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ import { createFileRoute, Outlet } from '@tanstack/react-router';

export const Route = createFileRoute('/configure/_layout')({
component: () => (
<div className="p-2 w-full h-full">
<h1 className="h2">Configuration</h1>
<Outlet />
<div className="p-2 w-full h-full pt-4 md:pt-32">
<div className="max-w-lg mx-auto space-y-4">
<h1 className="text-2xl font-bold text-text-secondary">
Configuration
</h1>
<div className="border border-border bg-card-background p-4 rounded-lg h-fit space-y-2 w-full ">
<Outlet />
</div>
</div>
</div>
),
});
7 changes: 7 additions & 0 deletions web/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ export default {
text: {
DEFAULT: '#2d3436',
inverse: 'white',
secondary: '#636e72',
},
border: {
DEFAULT: '#e0e0e0',
},
card: {
background: 'rgb(245,245,245)',
},
},
},
Expand Down

0 comments on commit 0580257

Please sign in to comment.