({
children,
...props
}: React.PropsWithChildren<FlexProps>)
| 27 | import { UnauthenticatedPageFooter } from "./PageFooter"; |
| 28 | |
| 29 | export const AuthLayout = ({ |
| 30 | children, |
| 31 | ...props |
| 32 | }: React.PropsWithChildren<FlexProps>) => { |
| 33 | const { colors } = useTheme<MaterializeTheme>(); |
| 34 | const appConfig = useAppConfig(); |
| 35 | const isOidc = |
| 36 | appConfig.mode === "self-managed" && appConfig.authMode === "Oidc"; |
| 37 | |
| 38 | return ( |
| 39 | <Center background={colors.background.primary} height="100vh" {...props}> |
| 40 | <VStack alignItems="stretch" flexGrow="1" spacing="0" height="100%"> |
| 41 | <Grid |
| 42 | gridTemplateColumns={{ base: "1fr", lg: isOidc ? "1fr" : "1fr 1fr" }} |
| 43 | gridTemplateRows={{ base: "1fr 3fr", lg: "1fr" }} |
| 44 | alignItems={{ base: "start", lg: "center" }} |
| 45 | height="100%" |
| 46 | width="100%" |
| 47 | > |
| 48 | {!isOidc && ( |
| 49 | <Hide below="lg"> |
| 50 | <HStack my="8" justifyContent="center" mx="12"> |
| 51 | <CodeBlock |
| 52 | lineNumbers |
| 53 | title="Create a user" |
| 54 | contents={`CREATE ROLE mat_admin WITH LOGIN PASSWORD 'password';`} |
| 55 | width="600px" |
| 56 | > |
| 57 | {`CREATE ROLE mat_admin WITH LOGIN PASSWORD 'password';`} |
| 58 | </CodeBlock> |
| 59 | </HStack> |
| 60 | </Hide> |
| 61 | )} |
| 62 | <Center |
| 63 | justifyContent={{ |
| 64 | base: "center", |
| 65 | lg: isOidc ? "center" : "flex-start", |
| 66 | }} |
| 67 | > |
| 68 | {children} |
| 69 | </Center> |
| 70 | </Grid> |
| 71 | <UnauthenticatedPageFooter /> |
| 72 | </VStack> |
| 73 | </Center> |
| 74 | ); |
| 75 | }; |
| 76 | |
| 77 | export const AuthContentContainer = ({ |
| 78 | children, |
nothing calls this directly
no test coverage detected