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

🔧 Make AuthorizationRouter "return" the AuthorizationState instead of true

This commit is contained in:
Steffo 2021-10-06 17:17:51 +02:00
parent 919cc3a4cb
commit fbf371cd27
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -1,10 +1,10 @@
import * as React from "react"
import {useAuthorizationContext} from "../../contexts/authorization"
import {AuthorizationState, useAuthorizationContext} from "../../contexts/authorization"
import {useSophonPath} from "../../hooks/useSophonPath"
import {ResourceRouter, ResourceRouterProps} from "../routing/ResourceRouter"
export function AuthorizationRouter({...props}: ResourceRouterProps<true>): JSX.Element {
export function AuthorizationRouter({...props}: ResourceRouterProps<AuthorizationState>): JSX.Element {
const path = useSophonPath()
const authorization = useAuthorizationContext()
@ -13,7 +13,7 @@ export function AuthorizationRouter({...props}: ResourceRouterProps<true>): JSX.
return (
<ResourceRouter
{...props}
selection={showDetails ? true : undefined}
selection={showDetails ? authorization?.state : undefined}
/>
)
}