31 lines
771 B
JavaScript
31 lines
771 B
JavaScript
import React from "react";
|
|
import { useSelector } from "react-redux";
|
|
import { Redirect, Link } from "react-router-dom";
|
|
|
|
export const UserActivation = () => {
|
|
const isLogged = useSelector((state) => state.user.isLogged);
|
|
const isActivated = useSelector((state) => state.user.isActivated);
|
|
|
|
if (!isLogged) {
|
|
return <Redirect to="/users/login" />;
|
|
}
|
|
|
|
if (isActivated) {
|
|
return <Redirect to="/" />;
|
|
}
|
|
|
|
return (
|
|
<div className="row">
|
|
<div className="col-12 col-md-8 offset-md-2">
|
|
<h2>Waiting for activation</h2>
|
|
<hr />
|
|
<h3>
|
|
Hang tight! Your user will soon be activated by the administrators of
|
|
this site.
|
|
</h3>
|
|
<Link to="/users/logout">Logout</Link>
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|