added resolvers, updated model, updated navbar

This commit is contained in:
lnn0q 2025-05-17 21:41:07 +03:00
parent a8375b99c2
commit 1d40d7e15f
23 changed files with 439 additions and 301 deletions

View file

@ -15,11 +15,11 @@ import { createFileRoute } from '@tanstack/react-router'
import { Route as rootRoute } from './pages/__root'
import { Route as RegisterImport } from './pages/register'
import { Route as LoginImport } from './pages/login'
import { Route as ExampleImport } from './pages/example'
import { Route as EditorImport } from './pages/editor'
import { Route as AboutImport } from './pages/about'
import { Route as IndexImport } from './pages/index'
import { Route as ProfileUsernameImport } from './pages/profile/$username'
import { Route as NewBookImport } from './pages/new/book'
// Create Virtual Routes
@ -45,12 +45,6 @@ const LoginRoute = LoginImport.update({
getParentRoute: () => rootRoute,
} as any)
const ExampleRoute = ExampleImport.update({
id: '/example',
path: '/example',
getParentRoute: () => rootRoute,
} as any)
const EditorRoute = EditorImport.update({
id: '/editor',
path: '/editor',
@ -75,6 +69,12 @@ const ProfileUsernameRoute = ProfileUsernameImport.update({
getParentRoute: () => rootRoute,
} as any)
const NewBookRoute = NewBookImport.update({
id: '/new/book',
path: '/new/book',
getParentRoute: () => rootRoute,
} as any)
// Populate the FileRoutesByPath interface
declare module '@tanstack/react-router' {
@ -100,13 +100,6 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof EditorImport
parentRoute: typeof rootRoute
}
'/example': {
id: '/example'
path: '/example'
fullPath: '/example'
preLoaderRoute: typeof ExampleImport
parentRoute: typeof rootRoute
}
'/login': {
id: '/login'
path: '/login'
@ -128,6 +121,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof BookLazyImport
parentRoute: typeof rootRoute
}
'/new/book': {
id: '/new/book'
path: '/new/book'
fullPath: '/new/book'
preLoaderRoute: typeof NewBookImport
parentRoute: typeof rootRoute
}
'/profile/$username': {
id: '/profile/$username'
path: '/profile/$username'
@ -144,10 +144,10 @@ export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/about': typeof AboutRoute
'/editor': typeof EditorRoute
'/example': typeof ExampleRoute
'/login': typeof LoginRoute
'/register': typeof RegisterRoute
'/book': typeof BookLazyRoute
'/new/book': typeof NewBookRoute
'/profile/$username': typeof ProfileUsernameRoute
}
@ -155,10 +155,10 @@ export interface FileRoutesByTo {
'/': typeof IndexRoute
'/about': typeof AboutRoute
'/editor': typeof EditorRoute
'/example': typeof ExampleRoute
'/login': typeof LoginRoute
'/register': typeof RegisterRoute
'/book': typeof BookLazyRoute
'/new/book': typeof NewBookRoute
'/profile/$username': typeof ProfileUsernameRoute
}
@ -167,10 +167,10 @@ export interface FileRoutesById {
'/': typeof IndexRoute
'/about': typeof AboutRoute
'/editor': typeof EditorRoute
'/example': typeof ExampleRoute
'/login': typeof LoginRoute
'/register': typeof RegisterRoute
'/book': typeof BookLazyRoute
'/new/book': typeof NewBookRoute
'/profile/$username': typeof ProfileUsernameRoute
}
@ -180,30 +180,30 @@ export interface FileRouteTypes {
| '/'
| '/about'
| '/editor'
| '/example'
| '/login'
| '/register'
| '/book'
| '/new/book'
| '/profile/$username'
fileRoutesByTo: FileRoutesByTo
to:
| '/'
| '/about'
| '/editor'
| '/example'
| '/login'
| '/register'
| '/book'
| '/new/book'
| '/profile/$username'
id:
| '__root__'
| '/'
| '/about'
| '/editor'
| '/example'
| '/login'
| '/register'
| '/book'
| '/new/book'
| '/profile/$username'
fileRoutesById: FileRoutesById
}
@ -212,10 +212,10 @@ export interface RootRouteChildren {
IndexRoute: typeof IndexRoute
AboutRoute: typeof AboutRoute
EditorRoute: typeof EditorRoute
ExampleRoute: typeof ExampleRoute
LoginRoute: typeof LoginRoute
RegisterRoute: typeof RegisterRoute
BookLazyRoute: typeof BookLazyRoute
NewBookRoute: typeof NewBookRoute
ProfileUsernameRoute: typeof ProfileUsernameRoute
}
@ -223,10 +223,10 @@ const rootRouteChildren: RootRouteChildren = {
IndexRoute: IndexRoute,
AboutRoute: AboutRoute,
EditorRoute: EditorRoute,
ExampleRoute: ExampleRoute,
LoginRoute: LoginRoute,
RegisterRoute: RegisterRoute,
BookLazyRoute: BookLazyRoute,
NewBookRoute: NewBookRoute,
ProfileUsernameRoute: ProfileUsernameRoute,
}
@ -243,10 +243,10 @@ export const routeTree = rootRoute
"/",
"/about",
"/editor",
"/example",
"/login",
"/register",
"/book",
"/new/book",
"/profile/$username"
]
},
@ -259,9 +259,6 @@ export const routeTree = rootRoute
"/editor": {
"filePath": "editor.tsx"
},
"/example": {
"filePath": "example.tsx"
},
"/login": {
"filePath": "login.tsx"
},
@ -271,6 +268,9 @@ export const routeTree = rootRoute
"/book": {
"filePath": "book.lazy.tsx"
},
"/new/book": {
"filePath": "new/book.tsx"
},
"/profile/$username": {
"filePath": "profile/$username.tsx"
}