mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
This refactoring simplify the code of the frontend and prepare the portal for receiving a user settings page and an admin page.
33 lines
933 B
TypeScript
33 lines
933 B
TypeScript
import React, { ReactNode, Fragment } from "react";
|
|
import { makeStyles, Typography, Link } from "@material-ui/core";
|
|
|
|
interface MethodContainerProps {
|
|
title: string;
|
|
explanation: string;
|
|
children: ReactNode;
|
|
|
|
onRegisterClick?: () => void;
|
|
}
|
|
|
|
export default function (props: MethodContainerProps) {
|
|
const style = useStyles();
|
|
return (
|
|
<Fragment>
|
|
<Typography variant="h6">{props.title}</Typography>
|
|
<div className={style.icon}>{props.children}</div>
|
|
<Typography>{props.explanation}</Typography>
|
|
{props.onRegisterClick
|
|
? <Link component="button" onClick={props.onRegisterClick}>
|
|
Not registered yet?
|
|
</Link>
|
|
: null}
|
|
</Fragment>
|
|
)
|
|
}
|
|
|
|
const useStyles = makeStyles(theme => ({
|
|
icon: {
|
|
paddingTop: theme.spacing(2),
|
|
paddingBottom: theme.spacing(2),
|
|
},
|
|
})); |