Progress
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
} from "../../redux/tech/tech.selectors";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import "./tech-login.styles.scss";
|
||||
import { Redirect } from "react-router-dom";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
technician: selectTechnician,
|
||||
@@ -30,14 +30,16 @@ export function TechLogin({
|
||||
techLoginStart,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleFinish = (values) => {
|
||||
techLoginStart(values);
|
||||
};
|
||||
|
||||
if (technician) return navigate("/tech/joblookup");
|
||||
|
||||
return (
|
||||
<div className="tech-login-container">
|
||||
{technician ? <Redirect to={`/tech/joblookup`} /> : null}
|
||||
<Form
|
||||
layout="vertical"
|
||||
onFinish={handleFinish}
|
||||
|
||||
Reference in New Issue
Block a user