refactor(lst): more dashboard work

This commit is contained in:
2025-02-20 13:18:47 -06:00
parent 604fdf1545
commit d939332499
13 changed files with 152 additions and 190 deletions

View File

@@ -17,9 +17,7 @@ import { Route as AuthImport } from './routes/_auth'
import { Route as IndexImport } from './routes/index'
import { Route as OcpIndexImport } from './routes/ocp/index'
import { Route as OcpLotsImport } from './routes/ocp/lots'
import { Route as OcpLineIDImport } from './routes/ocp/$lineID'
import { Route as AuthProfileImport } from './routes/_auth/profile'
import { Route as AuthDashboardImport } from './routes/_auth/dashboard'
// Create/Update Routes
@@ -58,24 +56,12 @@ const OcpLotsRoute = OcpLotsImport.update({
getParentRoute: () => rootRoute,
} as any)
const OcpLineIDRoute = OcpLineIDImport.update({
id: '/ocp/$lineID',
path: '/ocp/$lineID',
getParentRoute: () => rootRoute,
} as any)
const AuthProfileRoute = AuthProfileImport.update({
id: '/profile',
path: '/profile',
getParentRoute: () => AuthRoute,
} as any)
const AuthDashboardRoute = AuthDashboardImport.update({
id: '/dashboard',
path: '/dashboard',
getParentRoute: () => AuthRoute,
} as any)
// Populate the FileRoutesByPath interface
declare module '@tanstack/react-router' {
@@ -108,13 +94,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof LoginImport
parentRoute: typeof rootRoute
}
'/_auth/dashboard': {
id: '/_auth/dashboard'
path: '/dashboard'
fullPath: '/dashboard'
preLoaderRoute: typeof AuthDashboardImport
parentRoute: typeof AuthImport
}
'/_auth/profile': {
id: '/_auth/profile'
path: '/profile'
@@ -122,13 +101,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthProfileImport
parentRoute: typeof AuthImport
}
'/ocp/$lineID': {
id: '/ocp/$lineID'
path: '/ocp/$lineID'
fullPath: '/ocp/$lineID'
preLoaderRoute: typeof OcpLineIDImport
parentRoute: typeof rootRoute
}
'/ocp/lots': {
id: '/ocp/lots'
path: '/ocp/lots'
@@ -149,12 +121,10 @@ declare module '@tanstack/react-router' {
// Create and export the route tree
interface AuthRouteChildren {
AuthDashboardRoute: typeof AuthDashboardRoute
AuthProfileRoute: typeof AuthProfileRoute
}
const AuthRouteChildren: AuthRouteChildren = {
AuthDashboardRoute: AuthDashboardRoute,
AuthProfileRoute: AuthProfileRoute,
}
@@ -165,9 +135,7 @@ export interface FileRoutesByFullPath {
'': typeof AuthRouteWithChildren
'/about': typeof AboutRoute
'/login': typeof LoginRoute
'/dashboard': typeof AuthDashboardRoute
'/profile': typeof AuthProfileRoute
'/ocp/$lineID': typeof OcpLineIDRoute
'/ocp/lots': typeof OcpLotsRoute
'/ocp': typeof OcpIndexRoute
}
@@ -177,9 +145,7 @@ export interface FileRoutesByTo {
'': typeof AuthRouteWithChildren
'/about': typeof AboutRoute
'/login': typeof LoginRoute
'/dashboard': typeof AuthDashboardRoute
'/profile': typeof AuthProfileRoute
'/ocp/$lineID': typeof OcpLineIDRoute
'/ocp/lots': typeof OcpLotsRoute
'/ocp': typeof OcpIndexRoute
}
@@ -190,45 +156,23 @@ export interface FileRoutesById {
'/_auth': typeof AuthRouteWithChildren
'/about': typeof AboutRoute
'/login': typeof LoginRoute
'/_auth/dashboard': typeof AuthDashboardRoute
'/_auth/profile': typeof AuthProfileRoute
'/ocp/$lineID': typeof OcpLineIDRoute
'/ocp/lots': typeof OcpLotsRoute
'/ocp/': typeof OcpIndexRoute
}
export interface FileRouteTypes {
fileRoutesByFullPath: FileRoutesByFullPath
fullPaths:
| '/'
| ''
| '/about'
| '/login'
| '/dashboard'
| '/profile'
| '/ocp/$lineID'
| '/ocp/lots'
| '/ocp'
fullPaths: '/' | '' | '/about' | '/login' | '/profile' | '/ocp/lots' | '/ocp'
fileRoutesByTo: FileRoutesByTo
to:
| '/'
| ''
| '/about'
| '/login'
| '/dashboard'
| '/profile'
| '/ocp/$lineID'
| '/ocp/lots'
| '/ocp'
to: '/' | '' | '/about' | '/login' | '/profile' | '/ocp/lots' | '/ocp'
id:
| '__root__'
| '/'
| '/_auth'
| '/about'
| '/login'
| '/_auth/dashboard'
| '/_auth/profile'
| '/ocp/$lineID'
| '/ocp/lots'
| '/ocp/'
fileRoutesById: FileRoutesById
@@ -239,7 +183,6 @@ export interface RootRouteChildren {
AuthRoute: typeof AuthRouteWithChildren
AboutRoute: typeof AboutRoute
LoginRoute: typeof LoginRoute
OcpLineIDRoute: typeof OcpLineIDRoute
OcpLotsRoute: typeof OcpLotsRoute
OcpIndexRoute: typeof OcpIndexRoute
}
@@ -249,7 +192,6 @@ const rootRouteChildren: RootRouteChildren = {
AuthRoute: AuthRouteWithChildren,
AboutRoute: AboutRoute,
LoginRoute: LoginRoute,
OcpLineIDRoute: OcpLineIDRoute,
OcpLotsRoute: OcpLotsRoute,
OcpIndexRoute: OcpIndexRoute,
}
@@ -268,7 +210,6 @@ export const routeTree = rootRoute
"/_auth",
"/about",
"/login",
"/ocp/$lineID",
"/ocp/lots",
"/ocp/"
]
@@ -279,7 +220,6 @@ export const routeTree = rootRoute
"/_auth": {
"filePath": "_auth.tsx",
"children": [
"/_auth/dashboard",
"/_auth/profile"
]
},
@@ -289,17 +229,10 @@ export const routeTree = rootRoute
"/login": {
"filePath": "login.tsx"
},
"/_auth/dashboard": {
"filePath": "_auth/dashboard.tsx",
"parent": "/_auth"
},
"/_auth/profile": {
"filePath": "_auth/profile.tsx",
"parent": "/_auth"
},
"/ocp/$lineID": {
"filePath": "ocp/$lineID.tsx"
},
"/ocp/lots": {
"filePath": "ocp/lots.tsx"
},