diff options
| author | soryu <soryu@soryu.co> | 2026-01-24 19:06:58 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-24 19:06:58 +0000 |
| commit | a62242a3898acad6e3972f11afad5ee2810d4b04 (patch) | |
| tree | 490adb34c3b86605e2dfd5949d2582c9e0593fa8 /frontend/src/main.tsx | |
| parent | 579c983d3efb8f1414ffb45b9e031f741cce5f76 (diff) | |
| download | soryu-a62242a3898acad6e3972f11afad5ee2810d4b04.tar.gz soryu-a62242a3898acad6e3972f11afad5ee2810d4b04.zip | |
feat: update routes to nest files under contracts
- Add react-router-dom for client-side routing
- Create ContractList component to list all contracts
- Create ContractDetail component with tabs (overview, files, tasks, repos)
- Create FileDetail component to view individual files
- Configure routes:
- /contracts - list all contracts
- /contracts/:id - view contract details with Files tab
- /contracts/:contractId/files/:fileId - view file in contract context
- Remove standalone file routes (/files, /files/:id)
Files are now only accessible through their parent contract.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'frontend/src/main.tsx')
| -rw-r--r-- | frontend/src/main.tsx | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/frontend/src/main.tsx b/frontend/src/main.tsx index 9373927..a6eae5b 100644 --- a/frontend/src/main.tsx +++ b/frontend/src/main.tsx @@ -1,11 +1,42 @@ import React from 'react' import ReactDOM from 'react-dom/client' +import { createBrowserRouter, RouterProvider } from 'react-router-dom' import App from './App' +import { ContractList } from './components/ContractList' +import { ContractDetail } from './components/ContractDetail' +import { FileDetail } from './components/FileDetail' import './styles/pc98.css' import './styles/mobile.css' +// Route configuration: +// - /contracts - List all contracts +// - /contracts/:id - View contract details with tabs (including Files tab) +// - /contracts/:contractId/files/:fileId - View a specific file within contract context +// +// Note: Standalone file routes (/files, /files/:id) have been removed. +// Files are now only accessible through their parent contract. + +const router = createBrowserRouter([ + { + path: '/', + element: <App />, + }, + { + path: '/contracts', + element: <ContractList />, + }, + { + path: '/contracts/:id', + element: <ContractDetail />, + }, + { + path: '/contracts/:contractId/files/:fileId', + element: <FileDetail />, + }, +]) + ReactDOM.createRoot(document.getElementById('root')!).render( <React.StrictMode> - <App /> + <RouterProvider router={router} /> </React.StrictMode> ) |
