рефакторинг
This commit is contained in:
@@ -2,34 +2,39 @@ import { FC } from 'react'
|
||||
|
||||
import { Navigate, Route, Routes } from 'react-router-dom'
|
||||
|
||||
import { TemplateProvider } from '../context/TemplateContext'
|
||||
import { ElementsCreation } from '../page/ElementsCreation'
|
||||
import { ProtocolCreation } from '../page/ProtocolCreation'
|
||||
import { TemplateSetup } from '../page/TemplateSetup'
|
||||
import { TemplateProvider } from '@/entitiy/template/model/TemplateContext'
|
||||
import { ElementsCreation } from '@/page/ElementsCreation'
|
||||
import { ProtocolCreation } from '@/page/ProtocolCreation'
|
||||
import { TemplateEditPage } from '@/page/TemplateEditPage'
|
||||
import { TemplatesOverviewPage } from '@/page/TemplatesOverviewPage'
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { Layout } from './Layout'
|
||||
|
||||
const queryClient = new QueryClient()
|
||||
const App: FC = () => {
|
||||
return (
|
||||
<TemplateProvider>
|
||||
<Routes>
|
||||
<Route path="/" element={<Layout />}>
|
||||
<Route index element={<Navigate to="/templates" replace />} />
|
||||
<Route path="templates/" element={<TemplateSetup />} />
|
||||
<Route
|
||||
path="templates/:templateId/edit"
|
||||
element={<TemplateSetup />}
|
||||
/>
|
||||
<Route
|
||||
path="templates/:templateId/elements"
|
||||
element={<ElementsCreation />}
|
||||
/>
|
||||
<Route
|
||||
path="templates/:templateId/protocols"
|
||||
element={<ProtocolCreation />}
|
||||
/>
|
||||
</Route>
|
||||
</Routes>
|
||||
</TemplateProvider>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<TemplateProvider>
|
||||
<Routes>
|
||||
<Route path="/" element={<Layout />}>
|
||||
<Route index element={<Navigate to="/templates" replace />} />
|
||||
<Route path="templates/" element={<TemplatesOverviewPage />} />
|
||||
<Route
|
||||
path="templates/:templateId/edit"
|
||||
element={<TemplateEditPage />}
|
||||
/>
|
||||
<Route
|
||||
path="templates/:templateId/elements"
|
||||
element={<ElementsCreation />}
|
||||
/>
|
||||
<Route
|
||||
path="templates/:templateId/protocols"
|
||||
element={<ProtocolCreation />}
|
||||
/>
|
||||
</Route>
|
||||
</Routes>
|
||||
</TemplateProvider>
|
||||
</QueryClientProvider>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user