|
@@ -1,21 +1,21 @@
|
|
-import style from "./SignUpPage.module.scss";
|
|
|
|
-import { ReactComponent as LogoBig } from "../../../assets/img/logoBig.svg";
|
|
|
|
-import { NavLink, useNavigate } from "react-router-dom";
|
|
|
|
-import { useEffect } from "react";
|
|
|
|
-import { useDispatch, useSelector } from "react-redux";
|
|
|
|
-import { registration } from "../../../store/auth/actions/registrationAction";
|
|
|
|
-import { useInput } from "../../../hooks/useInput";
|
|
|
|
-import { Input } from "../../common/Input/Input";
|
|
|
|
-import { Validate } from "../../../utils/Validate";
|
|
|
|
-import { LoadingPage } from "../LoadingPage/LoadingPage";
|
|
|
|
|
|
+import style from './SignUpPage.module.scss';
|
|
|
|
+import { ReactComponent as LogoBig } from '../../assets/img/logoBig.svg';
|
|
|
|
+import { NavLink, useNavigate } from 'react-router-dom';
|
|
|
|
+import { useEffect } from 'react';
|
|
|
|
+import { useDispatch, useSelector } from 'react-redux';
|
|
|
|
+import { registration } from '../../store/auth/actions/registrationAction';
|
|
|
|
+import { useInput } from '../../hooks/useInput';
|
|
|
|
+import { Input } from '../../components/Input/Input';
|
|
|
|
+import { Validate } from '../../utils/Validate';
|
|
|
|
+import { LoadingPage } from '../LoadingPage/LoadingPage';
|
|
|
|
|
|
export const SignUpPage = () => {
|
|
export const SignUpPage = () => {
|
|
const dispatch = useDispatch();
|
|
const dispatch = useDispatch();
|
|
const navigate = useNavigate();
|
|
const navigate = useNavigate();
|
|
const { isAuth, error, loading } = useSelector((state) => state.auth);
|
|
const { isAuth, error, loading } = useSelector((state) => state.auth);
|
|
- const userName = useInput("", Validate.userName);
|
|
|
|
- const password = useInput("", Validate.password);
|
|
|
|
- const confirmPassword = useInput("", (value) =>
|
|
|
|
|
|
+ const userName = useInput('', Validate.userName);
|
|
|
|
+ const password = useInput('', Validate.password);
|
|
|
|
+ const confirmPassword = useInput('', (value) =>
|
|
Validate.confirmPassword(value, password.value)
|
|
Validate.confirmPassword(value, password.value)
|
|
);
|
|
);
|
|
const isError =
|
|
const isError =
|
|
@@ -40,7 +40,7 @@ export const SignUpPage = () => {
|
|
};
|
|
};
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
- if (isAuth) navigate("/your-works");
|
|
|
|
|
|
+ if (isAuth) navigate('/your-works');
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
}, [isAuth]);
|
|
}, [isAuth]);
|
|
|
|
|
|
@@ -64,7 +64,7 @@ export const SignUpPage = () => {
|
|
|
|
|
|
<Input
|
|
<Input
|
|
title="Password"
|
|
title="Password"
|
|
- type={"password"}
|
|
|
|
|
|
+ type={'password'}
|
|
value={password.value}
|
|
value={password.value}
|
|
onChange={password.onChange}
|
|
onChange={password.onChange}
|
|
error={password.error}
|
|
error={password.error}
|
|
@@ -72,7 +72,7 @@ export const SignUpPage = () => {
|
|
|
|
|
|
<Input
|
|
<Input
|
|
title="Confirm Password"
|
|
title="Confirm Password"
|
|
- type={"password"}
|
|
|
|
|
|
+ type={'password'}
|
|
value={confirmPassword.value}
|
|
value={confirmPassword.value}
|
|
onChange={confirmPassword.onChange}
|
|
onChange={confirmPassword.onChange}
|
|
error={confirmPassword.error}
|
|
error={confirmPassword.error}
|