2021-10-13 02:51:55 +00:00
|
|
|
import {faProjectDiagram, faUsers} from "@fortawesome/free-solid-svg-icons"
|
2021-10-06 00:52:06 +00:00
|
|
|
import * as Reach from "@reach/router"
|
|
|
|
import {RouteComponentProps} from "@reach/router"
|
2021-10-12 02:40:48 +00:00
|
|
|
import {Chapter, LayoutThreeCol} from "@steffo/bluelib-react"
|
2021-10-06 00:52:06 +00:00
|
|
|
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-13 02:45:53 +00:00
|
|
|
import {ResourceDescriptionBox} from "./components/generic/ResourceDescriptionBox"
|
2021-10-10 15:40:14 +00:00
|
|
|
import {GroupCreateBox} from "./components/group/GroupCreateBox"
|
2021-10-12 02:40:48 +00:00
|
|
|
import {GroupMembersBox} from "./components/group/GroupMembersBox"
|
2021-10-07 00:14:34 +00:00
|
|
|
import {GroupRouter} from "./components/group/GroupRouter"
|
2021-10-14 01:43:05 +00:00
|
|
|
import {GroupStepPage} from "./components/group/GroupStepPage"
|
2021-10-13 03:05:34 +00:00
|
|
|
import {SophonDescriptionBox} from "./components/informative/SophonDescriptionBox"
|
2021-10-12 00:17:54 +00:00
|
|
|
import {InstanceDescriptionBox} from "./components/instance/InstanceDescriptionBox"
|
2021-10-13 03:05:34 +00:00
|
|
|
import {InstanceFormBox} from "./components/instance/InstanceFormBox"
|
2021-10-06 00:52:06 +00:00
|
|
|
import {InstanceRouter} from "./components/instance/InstanceRouter"
|
2021-10-14 03:05:01 +00:00
|
|
|
import {NotebookCreateBox} from "./components/notebook/NotebookCreateBox"
|
2021-10-15 15:22:11 +00:00
|
|
|
import {NotebookDescriptionBox} from "./components/notebook/NotebookDescriptionBox"
|
2021-10-07 03:32:38 +00:00
|
|
|
import {NotebookListBox} from "./components/notebook/NotebookListBox"
|
|
|
|
import {NotebookRouter} from "./components/notebook/NotebookRouter"
|
2021-10-14 01:43:05 +00:00
|
|
|
import {ProjectCreateBox} from "./components/project/ProjectCreateBox"
|
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-17 00:07:29 +00:00
|
|
|
import {BreadcrumbsBox} from "./components/routing/BreadcrumbsBox"
|
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"
|
2021-10-12 02:12:17 +00:00
|
|
|
import {CacheProvider} from "./contexts/cache"
|
2021-10-14 01:43:05 +00:00
|
|
|
import {GroupProvider} from "./contexts/group"
|
2021-10-06 00:52:06 +00:00
|
|
|
import {InstanceProvider} from "./contexts/instance"
|
2021-10-14 03:05:01 +00:00
|
|
|
import {NotebookProvider} from "./contexts/notebook"
|
|
|
|
import {ProjectProvider} from "./contexts/project"
|
2021-10-06 00:52:06 +00:00
|
|
|
import {ThemeProvider} from "./contexts/theme"
|
2021-08-29 20:58:31 +00:00
|
|
|
|
2021-09-29 23:50:45 +00:00
|
|
|
|
2021-10-10 15:11:40 +00:00
|
|
|
function App({..._}: RouteComponentProps) {
|
2021-10-13 01:39:38 +00:00
|
|
|
return React.useMemo(
|
2021-10-13 03:05:34 +00:00
|
|
|
() => <>
|
2021-10-15 16:15:06 +00:00
|
|
|
<LayoutThreeCol>
|
|
|
|
<LayoutThreeCol.Center>
|
|
|
|
<ThemedTitle level={1}/>
|
|
|
|
<ErrorCatcherBox>
|
2021-10-17 00:07:29 +00:00
|
|
|
<BreadcrumbsBox/>
|
2021-10-15 16:15:06 +00:00
|
|
|
<Chapter>
|
|
|
|
<SophonDescriptionBox/>
|
|
|
|
</Chapter>
|
|
|
|
<InstanceProvider>
|
|
|
|
<InstanceRouter
|
|
|
|
unselectedRoute={() => <>
|
|
|
|
<InstanceFormBox/>
|
|
|
|
</>}
|
|
|
|
selectedRoute={() => <>
|
|
|
|
<Chapter>
|
|
|
|
<InstanceDescriptionBox/>
|
|
|
|
</Chapter>
|
|
|
|
<AuthorizationProvider>
|
|
|
|
<CacheProvider>
|
|
|
|
<AuthorizationRouter
|
|
|
|
unselectedRoute={AuthorizationStepPage}
|
|
|
|
selectedRoute={() => <>
|
|
|
|
<GroupRouter
|
|
|
|
unselectedRoute={GroupStepPage}
|
|
|
|
selectedRoute={({selection}) => <>
|
|
|
|
<GroupProvider resource={selection}>
|
|
|
|
<Chapter>
|
|
|
|
<ResourceDescriptionBox resource={selection} icon={faUsers}/>
|
|
|
|
<GroupMembersBox/>
|
|
|
|
</Chapter>
|
|
|
|
<ProjectRouter
|
|
|
|
groupPk={selection.value.slug}
|
|
|
|
unselectedRoute={({viewSet}) => <>
|
|
|
|
<GroupCreateBox resource={selection}/>
|
|
|
|
<ProjectListBox viewSet={viewSet}/>
|
|
|
|
<ProjectCreateBox viewSet={viewSet}/>
|
|
|
|
</>}
|
|
|
|
selectedRoute={({selection}) => <>
|
|
|
|
<ProjectProvider resource={selection}>
|
|
|
|
<ResourceDescriptionBox resource={selection} icon={faProjectDiagram}/>
|
|
|
|
<NotebookRouter
|
|
|
|
projectPk={selection.value.slug}
|
|
|
|
unselectedRoute={({viewSet}) => <>
|
|
|
|
<ProjectCreateBox resource={selection}/>
|
|
|
|
<NotebookListBox viewSet={viewSet}/>
|
|
|
|
<NotebookCreateBox viewSet={viewSet}/>
|
|
|
|
</>}
|
|
|
|
selectedRoute={({selection}) => <>
|
|
|
|
<NotebookProvider resource={selection}>
|
|
|
|
<NotebookDescriptionBox/>
|
|
|
|
<NotebookCreateBox resource={selection}/>
|
|
|
|
</NotebookProvider>
|
|
|
|
</>}
|
|
|
|
/>
|
|
|
|
</ProjectProvider>
|
|
|
|
</>}
|
|
|
|
/>
|
|
|
|
</GroupProvider>
|
|
|
|
</>}
|
|
|
|
/>
|
2021-10-15 16:07:45 +00:00
|
|
|
</>}
|
|
|
|
/>
|
2021-10-15 16:15:06 +00:00
|
|
|
</CacheProvider>
|
|
|
|
</AuthorizationProvider>
|
|
|
|
</>}
|
|
|
|
/>
|
|
|
|
</InstanceProvider>
|
|
|
|
</ErrorCatcherBox>
|
|
|
|
<SophonFooter/>
|
|
|
|
</LayoutThreeCol.Center>
|
|
|
|
</LayoutThreeCol>
|
2021-10-13 03:05:34 +00:00
|
|
|
</>,
|
2021-10-13 01:39:38 +00:00
|
|
|
[],
|
2021-10-06 00:52:06 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default function AppWrapper() {
|
|
|
|
return (
|
|
|
|
<ThemeProvider>
|
|
|
|
<ThemedBluelib>
|
2021-10-15 16:15:06 +00:00
|
|
|
<Reach.Router>
|
|
|
|
<App default/>
|
|
|
|
</Reach.Router>
|
2021-10-06 00:52:06 +00:00
|
|
|
</ThemedBluelib>
|
|
|
|
</ThemeProvider>
|
|
|
|
)
|
2021-08-29 20:58:31 +00:00
|
|
|
}
|