-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a17386e
commit 0ee27ad
Showing
59 changed files
with
787 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
declare module '@tanstack/react-router' { | ||
interface Register { | ||
router: typeof import('../app/main').router; | ||
} | ||
type AllRouteIds = import('@tanstack/react-router').RouteIds< | ||
typeof import('../app/routeTree.gen').routeTree | ||
>; | ||
} | ||
|
||
export {}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,38 @@ | ||
import 'dayjs/locale/fa'; | ||
import '@camp/zod-addons/monkey-patch'; | ||
import 'dayjs/locale/fa'; | ||
|
||
import { ApolloProvider } from '@camp/api-client'; | ||
import { AuthProvider } from '@camp/auth'; | ||
import { config } from '@camp/config'; | ||
import { debug, DebugScopes } from '@camp/debug'; | ||
import { ThemeProvider } from '@camp/design'; | ||
import type { AllRouteIds } from '@camp/router'; | ||
import { createRouter, RouterProvider } from '@camp/router'; | ||
import { StrictMode } from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
|
||
import { Routes } from './Routes'; | ||
import { routeTree } from './routeTree.gen'; | ||
|
||
export interface RouterContext { | ||
getTitle: (to: AllRouteIds) => string; | ||
} | ||
|
||
export const router = createRouter({ | ||
routeTree, | ||
context: { | ||
getTitle: x => { | ||
const routeTitles: Partial<Record<AllRouteIds, string>> = { | ||
'/dashboard/_layout/households/_layout': 'خانوار', | ||
'/dashboard/_layout/households/_layout/$householdId': 'خانواده', | ||
}; | ||
|
||
return routeTitles[x] ?? ''; | ||
}, | ||
}, | ||
}); | ||
|
||
const root = ReactDOM.createRoot(document.getElementById('root')!); | ||
debug.log(DebugScopes.All, config); | ||
|
||
root.render( | ||
<StrictMode> | ||
<AuthProvider> | ||
<ApolloProvider> | ||
<ThemeProvider> | ||
<Routes /> | ||
</ThemeProvider> | ||
</ApolloProvider> | ||
</AuthProvider> | ||
<RouterProvider router={router} /> | ||
</StrictMode>, | ||
); |
Oops, something went wrong.