authelia/client/src/components/AlreadyAuthenticated/AlreadyAuthenticated.tsx

43 lines
1.3 KiB
TypeScript
Raw Normal View History

2019-01-20 02:10:43 +07:00
import React, { Component } from "react";
import classnames from 'classnames';
2019-01-20 02:10:43 +07:00
import styles from '../../assets/scss/components/AlreadyAuthenticated/AlreadyAuthenticated.module.scss';
import Button from "@material/react-button";
2019-01-20 02:10:43 +07:00
import CircleLoader, { Status } from "../CircleLoader/CircleLoader";
export interface OwnProps {
username: string;
redirectionUrl: string | null;
2019-01-20 02:10:43 +07:00
}
export interface DispatchProps {
onLogoutClicked: () => void;
}
export type Props = OwnProps & DispatchProps;
2019-01-20 02:10:43 +07:00
class AlreadyAuthenticated extends Component<Props> {
render() {
return (
<div className={classnames(styles.container, 'already-authenticated-step')}>
<div className={styles.successContainer}>
<div className={styles.messageContainer}>
<span className={styles.username}>{this.props.username}</span>
2019-01-20 02:10:43 +07:00
you are authenticated
</div>
<div className={styles.statusIcon}><CircleLoader status={Status.SUCCESSFUL} /></div>
2019-01-20 02:10:43 +07:00
</div>
{(this.props.redirectionUrl) ? <a href={this.props.redirectionUrl}>{this.props.redirectionUrl}</a> : null}
<div className={styles.logoutButtonContainer}>
2019-01-20 02:10:43 +07:00
<Button
onClick={this.props.onLogoutClicked}
color="red">
2019-01-20 02:10:43 +07:00
Logout
</Button>
</div>
</div>
)
}
}
export default AlreadyAuthenticated;