Grégoire Delattre 4b26080193
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Update redux state management
Use immer with native javascript objects instead of immutablejs.
2020-04-07 18:22:26 +02:00

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