2019-01-20 02:10:43 +07:00
|
|
|
import React, { Component } from "react";
|
2019-01-30 22:47:03 +07:00
|
|
|
import classnames from 'classnames';
|
2019-01-20 02:10:43 +07:00
|
|
|
|
2019-01-26 21:29:12 +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;
|
2019-03-04 05:51:52 +07:00
|
|
|
redirectionUrl: string | null;
|
2019-01-20 02:10:43 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface DispatchProps {
|
|
|
|
onLogoutClicked: () => void;
|
|
|
|
}
|
|
|
|
|
2019-01-26 21:29:12 +07:00
|
|
|
export type Props = OwnProps & DispatchProps;
|
2019-01-20 02:10:43 +07:00
|
|
|
|
|
|
|
class AlreadyAuthenticated extends Component<Props> {
|
|
|
|
render() {
|
|
|
|
return (
|
2019-01-30 22:47:03 +07:00
|
|
|
<div className={classnames(styles.container, 'already-authenticated-step')}>
|
2019-01-26 21:29:12 +07:00
|
|
|
<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
|
2019-01-26 21:29:12 +07:00
|
|
|
</div>
|
|
|
|
<div className={styles.statusIcon}><CircleLoader status={Status.SUCCESSFUL} /></div>
|
2019-01-20 02:10:43 +07:00
|
|
|
</div>
|
2019-03-04 05:51:52 +07:00
|
|
|
{(this.props.redirectionUrl) ? <a href={this.props.redirectionUrl}>{this.props.redirectionUrl}</a> : null}
|
2019-01-26 21:29:12 +07:00
|
|
|
<div className={styles.logoutButtonContainer}>
|
2019-01-20 02:10:43 +07:00
|
|
|
<Button
|
|
|
|
onClick={this.props.onLogoutClicked}
|
2019-01-26 21:29:12 +07:00
|
|
|
color="red">
|
2019-01-20 02:10:43 +07:00
|
|
|
Logout
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-26 21:29:12 +07:00
|
|
|
export default AlreadyAuthenticated;
|