forked from cerc-io/snowballtools-base
Nabarun Gogoi
413ed03eb8
* Implement dropdown for organizations switcher * Add dynamic route for organization id * Update routes for organization slug * Use organization slug for adding project * Refactor to fetch organizations at sidebar component * Update organization switcher based on searched project * Refactor types in frontend --------- Co-authored-by: neeraj <neeraj.rtly@gmail.com>
58 lines
1.2 KiB
TypeScript
58 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
|
|
|
|
import OrgSlug from './pages/OrgSlug';
|
|
import Projects from './pages/org-slug';
|
|
import Settings from './pages/org-slug/Settings';
|
|
import {
|
|
projectsRoutesWithSearch,
|
|
projectsRoutesWithoutSearch,
|
|
} from './pages/org-slug/projects/routes';
|
|
import ProjectSearchLayout from './layouts/ProjectSearch';
|
|
import { OctokitProvider } from './context/OctokitContext';
|
|
import Index from './pages';
|
|
|
|
const router = createBrowserRouter([
|
|
{
|
|
path: ':orgSlug',
|
|
element: <OrgSlug />,
|
|
children: [
|
|
{
|
|
element: <ProjectSearchLayout />,
|
|
children: [
|
|
{
|
|
path: '',
|
|
element: <Projects />,
|
|
},
|
|
{
|
|
path: 'projects',
|
|
children: projectsRoutesWithSearch,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: 'settings',
|
|
element: <Settings />,
|
|
},
|
|
{
|
|
path: 'projects',
|
|
children: projectsRoutesWithoutSearch,
|
|
},
|
|
],
|
|
},
|
|
{
|
|
path: '/',
|
|
element: <Index />,
|
|
},
|
|
]);
|
|
|
|
function App() {
|
|
return (
|
|
<OctokitProvider>
|
|
<RouterProvider router={router} />
|
|
</OctokitProvider>
|
|
);
|
|
}
|
|
|
|
export default App;
|