2021-10-06 00:52:06 +00:00
|
|
|
import * as Reach from "@reach/router"
|
|
|
|
import {RouteComponentProps} from "@reach/router"
|
|
|
|
import {LayoutThreeCol} from "@steffo/bluelib-react"
|
|
|
|
import * as React from "react"
|
|
|
|
import {AuthorizationRouter} from "./components/authorization/AuthorizationRouter"
|
|
|
|
import {AuthorizationStepPage} from "./components/authorization/AuthorizationStepPage"
|
|
|
|
import {SophonFooter} from "./components/elements/SophonFooter"
|
|
|
|
import {ErrorCatcherBox} from "./components/errors/ErrorCatcherBox"
|
2021-10-07 00:36:49 +00:00
|
|
|
import {GroupListBox} from "./components/group/GroupListBox"
|
2021-10-07 00:14:34 +00:00
|
|
|
import {GroupRouter} from "./components/group/GroupRouter"
|
2021-10-06 00:52:06 +00:00
|
|
|
import {InstanceRouter} from "./components/instance/InstanceRouter"
|
|
|
|
import {InstanceStepPage} from "./components/instance/InstanceStepPage"
|
2021-10-07 03:32:38 +00:00
|
|
|
import {NotebookListBox} from "./components/notebook/NotebookListBox"
|
|
|
|
import {NotebookRouter} from "./components/notebook/NotebookRouter"
|
2021-10-06 00:52:06 +00:00
|
|
|
import {DebugBox} from "./components/placeholder/DebugBox"
|
2021-10-07 03:25:53 +00:00
|
|
|
import {ProjectListBox} from "./components/project/ProjectListBox"
|
2021-10-07 03:17:45 +00:00
|
|
|
import {ProjectRouter} from "./components/project/ProjectRouter"
|
2021-10-06 00:52:06 +00:00
|
|
|
import {ThemedBluelib} from "./components/theme/ThemedBluelib"
|
|
|
|
import {ThemedTitle} from "./components/theme/ThemedTitle"
|
|
|
|
import {AuthorizationProvider} from "./contexts/authorization"
|
|
|
|
import {InstanceProvider} from "./contexts/instance"
|
|
|
|
import {ThemeProvider} from "./contexts/theme"
|
2021-08-29 20:58:31 +00:00
|
|
|
|
2021-09-29 23:50:45 +00:00
|
|
|
|
2021-10-07 00:36:49 +00:00
|
|
|
function App({}: RouteComponentProps) {
|
2021-09-08 16:05:01 +00:00
|
|
|
return (
|
2021-10-06 00:52:06 +00:00
|
|
|
<InstanceProvider>
|
|
|
|
<InstanceRouter
|
|
|
|
unselectedRoute={() => <>
|
|
|
|
<InstanceStepPage/>
|
|
|
|
</>}
|
|
|
|
selectedRoute={() => <>
|
|
|
|
<AuthorizationProvider>
|
|
|
|
<AuthorizationRouter
|
|
|
|
unselectedRoute={() => <>
|
|
|
|
<AuthorizationStepPage/>
|
|
|
|
</>}
|
2021-10-07 00:14:34 +00:00
|
|
|
selectedRoute={() => <>
|
|
|
|
<GroupRouter
|
2021-10-07 03:06:31 +00:00
|
|
|
unselectedRoute={(props) => <GroupListBox viewSet={props.viewSet}/>}
|
2021-10-07 03:17:45 +00:00
|
|
|
selectedRoute={(props) => <>
|
|
|
|
<ProjectRouter
|
|
|
|
groupPk={props.selection.value.slug}
|
2021-10-07 03:25:53 +00:00
|
|
|
unselectedRoute={(props) => <ProjectListBox viewSet={props.viewSet}/>}
|
2021-10-07 03:32:38 +00:00
|
|
|
selectedRoute={(props) => <>
|
|
|
|
<NotebookRouter
|
|
|
|
projectPk={props.selection.value.slug}
|
|
|
|
unselectedRoute={(props) => <NotebookListBox viewSet={props.viewSet}/>}
|
|
|
|
selectedRoute={DebugBox}
|
|
|
|
/>
|
|
|
|
</>}
|
2021-10-07 03:17:45 +00:00
|
|
|
/>
|
|
|
|
</>}
|
2021-10-07 00:14:34 +00:00
|
|
|
/>
|
|
|
|
</>}
|
2021-10-06 00:52:06 +00:00
|
|
|
/>
|
|
|
|
</AuthorizationProvider>
|
|
|
|
</>}
|
|
|
|
/>
|
|
|
|
</InstanceProvider>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default function AppWrapper() {
|
|
|
|
return (
|
|
|
|
<ThemeProvider>
|
|
|
|
<ThemedBluelib>
|
|
|
|
<LayoutThreeCol>
|
|
|
|
<LayoutThreeCol.Center>
|
|
|
|
<ThemedTitle level={1}/>
|
|
|
|
<ErrorCatcherBox>
|
|
|
|
<Reach.Router>
|
|
|
|
<App default/>
|
|
|
|
</Reach.Router>
|
|
|
|
</ErrorCatcherBox>
|
|
|
|
<SophonFooter/>
|
|
|
|
</LayoutThreeCol.Center>
|
|
|
|
</LayoutThreeCol>
|
|
|
|
</ThemedBluelib>
|
|
|
|
</ThemeProvider>
|
|
|
|
)
|
2021-08-29 20:58:31 +00:00
|
|
|
}
|