diff --git a/src/routeTree.gen.ts b/src/routeTree.gen.ts index 5e68293..7642cb7 100644 --- a/src/routeTree.gen.ts +++ b/src/routeTree.gen.ts @@ -12,6 +12,7 @@ import { Route as rootRoute } from './routes/__root' import { Route as IndexImport } from './routes/index' +import { Route as ContactsContractIdImport } from './routes/contacts.$contractId' // Create/Update Routes @@ -21,6 +22,12 @@ const IndexRoute = IndexImport.update({ getParentRoute: () => rootRoute, } as any) +const ContactsContractIdRoute = ContactsContractIdImport.update({ + id: '/contacts/$contractId', + path: '/contacts/$contractId', + getParentRoute: () => rootRoute, +} as any) + // Populate the FileRoutesByPath interface declare module '@tanstack/react-router' { @@ -32,6 +39,13 @@ declare module '@tanstack/react-router' { preLoaderRoute: typeof IndexImport parentRoute: typeof rootRoute } + '/contacts/$contractId': { + id: '/contacts/$contractId' + path: '/contacts/$contractId' + fullPath: '/contacts/$contractId' + preLoaderRoute: typeof ContactsContractIdImport + parentRoute: typeof rootRoute + } } } @@ -39,32 +53,37 @@ declare module '@tanstack/react-router' { export interface FileRoutesByFullPath { '/': typeof IndexRoute + '/contacts/$contractId': typeof ContactsContractIdRoute } export interface FileRoutesByTo { '/': typeof IndexRoute + '/contacts/$contractId': typeof ContactsContractIdRoute } export interface FileRoutesById { __root__: typeof rootRoute '/': typeof IndexRoute + '/contacts/$contractId': typeof ContactsContractIdRoute } export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath - fullPaths: '/' + fullPaths: '/' | '/contacts/$contractId' fileRoutesByTo: FileRoutesByTo - to: '/' - id: '__root__' | '/' + to: '/' | '/contacts/$contractId' + id: '__root__' | '/' | '/contacts/$contractId' fileRoutesById: FileRoutesById } export interface RootRouteChildren { IndexRoute: typeof IndexRoute + ContactsContractIdRoute: typeof ContactsContractIdRoute } const rootRouteChildren: RootRouteChildren = { IndexRoute: IndexRoute, + ContactsContractIdRoute: ContactsContractIdRoute, } export const routeTree = rootRoute @@ -77,11 +96,15 @@ export const routeTree = rootRoute "__root__": { "filePath": "__root.tsx", "children": [ - "/" + "/", + "/contacts/$contractId" ] }, "/": { "filePath": "index.tsx" + }, + "/contacts/$contractId": { + "filePath": "contacts.$contractId.tsx" } } } diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx index ee16358..f657013 100644 --- a/src/routes/__root.tsx +++ b/src/routes/__root.tsx @@ -1,4 +1,4 @@ -import { createRootRoute } from '@tanstack/react-router'; +import { Outlet, createRootRoute, Link } from '@tanstack/react-router'; import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'; export const Route = createRootRoute({ @@ -24,14 +24,17 @@ export const Route = createRootRoute({ +
{contact.notes}
: null} + +