1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-21 22:34:21 +00:00

Create GroupDescriptionBox

This commit is contained in:
Steffo 2021-10-12 02:17:54 +02:00
parent 13e7e4b97c
commit 23d463f434
3 changed files with 36 additions and 11 deletions

View file

@ -7,8 +7,10 @@ import {AuthorizationStepPage} from "./components/authorization/AuthorizationSte
import {SophonFooter} from "./components/elements/SophonFooter"
import {ErrorCatcherBox} from "./components/errors/ErrorCatcherBox"
import {GroupCreateBox} from "./components/group/GroupCreateBox"
import {GroupDescriptionBox} from "./components/group/GroupDescriptionBox"
import {GroupListBox} from "./components/group/GroupListBox"
import {GroupRouter} from "./components/group/GroupRouter"
import {InstanceDescriptionBox} from "./components/instance/InstanceDescriptionBox"
import {InstanceRouter} from "./components/instance/InstanceRouter"
import {InstanceStepPage} from "./components/instance/InstanceStepPage"
import {NotebookListBox} from "./components/notebook/NotebookListBox"
@ -31,6 +33,7 @@ function App({..._}: RouteComponentProps) {
<InstanceStepPage/>
</>}
selectedRoute={() => <>
<InstanceDescriptionBox/>
<AuthorizationProvider>
<AuthorizationRouter
unselectedRoute={() => <>
@ -38,18 +41,19 @@ function App({..._}: RouteComponentProps) {
</>}
selectedRoute={() => <>
<GroupRouter
unselectedRoute={(props) => <>
<GroupListBox viewSet={props.viewSet}/>
<GroupCreateBox viewSet={props.viewSet}/>
unselectedRoute={({viewSet}) => <>
<GroupListBox viewSet={viewSet}/>
<GroupCreateBox viewSet={viewSet}/>
</>}
selectedRoute={(props) => <>
selectedRoute={({selection}) => <>
<GroupDescriptionBox resource={selection}/>
<ProjectRouter
groupPk={props.selection.value.slug}
unselectedRoute={(props) => <ProjectListBox viewSet={props.viewSet}/>}
selectedRoute={(props) => <>
groupPk={selection.value.slug}
unselectedRoute={({viewSet}) => <ProjectListBox viewSet={viewSet}/>}
selectedRoute={({selection}) => <>
<NotebookRouter
projectPk={props.selection.value.slug}
unselectedRoute={(props) => <NotebookListBox viewSet={props.viewSet}/>}
projectPk={selection.value.slug}
unselectedRoute={({viewSet}) => <NotebookListBox viewSet={viewSet}/>}
selectedRoute={DebugBox}
/>
</>}

View file

@ -1,7 +1,6 @@
import {Chapter} from "@steffo/bluelib-react"
import * as React from "react"
import {useAuthorizationContext} from "../../contexts/authorization"
import {InstanceDescriptionBox} from "../instance/InstanceDescriptionBox"
import {AuthorizationAdminBox} from "./AuthorizationAdminBox"
import {AuthorizationBrowseBox} from "./AuthorizationBrowseBox"
import {AuthorizationLoginBox} from "./AuthorizationLoginBox"
@ -43,7 +42,6 @@ export function AuthorizationStepPage(): JSX.Element {
)
return <>
<InstanceDescriptionBox/>
{loginChapter}
<Chapter>
<AuthorizationAdminBox/>

View file

@ -0,0 +1,23 @@
import {Box, Heading} from "@steffo/bluelib-react"
import * as React from "react"
import {ManagedResource} from "../../hooks/useManagedViewSet"
import {SophonResearchGroup} from "../../types/SophonTypes"
export interface GroupDescriptionBoxProps {
resource: ManagedResource<SophonResearchGroup>
}
export function GroupDescriptionBox({resource}: GroupDescriptionBoxProps): JSX.Element {
return (
<Box>
<Heading level={3}>
{resource.value.name}
</Heading>
<pre>
{resource.value.description}
</pre>
</Box>
)
}