1
0
mirror of https://github.com/0rangebananaspy/authelia.git synced 2024-09-14 22:47:21 +07:00
authelia/web/src/views/LoginPortal/SecondFactor/MethodContainer.tsx
Clement Michaud 9ae2096d2a Rewrite authelia frontend to improve user experience.
This refactoring simplify the code of the frontend and prepare the
portal for receiving a user settings page and an admin page.
2019-12-05 11:05:24 +01:00

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),
},
}));