diff --git a/src/components/AuthBox/AuthBox.js b/src/components/AuthBox/AuthBox.js index d07661e4..89501c22 100644 --- a/src/components/AuthBox/AuthBox.js +++ b/src/components/AuthBox/AuthBox.js @@ -1,29 +1,27 @@ -import React, {useEffect, useRef, useState} from 'react' -import {Link, useNavigate} from 'react-router-dom' -import {useDispatch, useSelector} from 'react-redux' +import React, { useEffect, useRef, useState } from "react"; +import { Link, useNavigate } from "react-router-dom"; +import { useDispatch, useSelector } from "react-redux"; -import {Loader} from '../Loader/Loader' +import { Loader } from "../Loader/Loader"; import ErrorBoundary from "../../hoc/ErrorBoundary"; -import {auth, selectAuth, setUserInfo} from '../../redux/outstaffingSlice' -import {loading} from '../../redux/loaderSlice' -import {setRole} from '../../redux/roleSlice' -import {selectIsLoading} from '../../redux/loaderSlice' +import { auth, selectAuth, setUserInfo } from "../../redux/outstaffingSlice"; +import { loading } from "../../redux/loaderSlice"; +import { setRole } from "../../redux/roleSlice"; +import { selectIsLoading } from "../../redux/loaderSlice"; -import {apiRequest} from "../../api/request"; +import { apiRequest } from "../../api/request"; -import ellipse from '../../images/ellipse.png' +import ellipse from "../../images/ellipse.png"; -import './authBox.scss' +import "./authBox.scss"; -import Swal from 'sweetalert2' -import withReactContent from 'sweetalert2-react-content' +import Swal from "sweetalert2"; +import withReactContent from "sweetalert2-react-content"; const SweetAlert = withReactContent(Swal); - -export const AuthBox = ({title, altTitle, roleChangeLink}) => { - +export const AuthBox = ({ title, altTitle, roleChangeLink }) => { const dispatch = useDispatch(); const ref = useRef(); const navigate = useNavigate(); @@ -35,125 +33,107 @@ export const AuthBox = ({title, altTitle, roleChangeLink}) => { const handleModalError = (error) => { SweetAlert.fire({ - title: 'Ошибка', - text: error + title: "Ошибка", + text: error, }); - setError(null) - + setError(null); }; useEffect(() => { - if (!localStorage.getItem('auth_token')) { - dispatch(auth(false)) + if (!localStorage.getItem("auth_token")) { + dispatch(auth(false)); } }, []); useEffect(() => { if (isAuth) { - navigate('/') + navigate("/"); } }); - const submitHandler = () => { - let formData = new FormData(ref.current); if (!isLoading) { dispatch(loading(true)); - apiRequest('/user/login', - { - method: 'POST', - data: formData - }).then((res) => { - + apiRequest("/user/login", { + method: "POST", + data: formData, + }).then((res) => { if (!res.access_token) { - - setError('Некорректные данные для входа'); - dispatch(loading(false)) - + setError("Некорректные данные для входа"); + dispatch(loading(false)); } else { - - localStorage.setItem('auth_token', res.access_token); - localStorage.setItem('id', res.id); - localStorage.setItem('cardId', res.card_id); - localStorage.setItem('role_status', res.status); + localStorage.setItem("auth_token", res.access_token); + localStorage.setItem("id", res.id); + localStorage.setItem("cardId", res.card_id); + localStorage.setItem("role_status", res.status); localStorage.setItem( - 'access_token_expired_at', - res.access_token_expired_at + "access_token_expired_at", + res.access_token_expired_at ); dispatch(auth(true)); dispatch(setUserInfo(res)); dispatch(loading(false)); - dispatch(setRole('ROLE_PARTNER')) + dispatch(setRole("ROLE_PARTNER")); } - }) + }); } }; return ( -
-

- Войти в систему -

-
- - {title} -
-
- - - - - - - {error && ( -
- - - - { - handleModalError(error) - } - {/* setError(null)}*/} - {/*/>*/} - -
- )} - -
- - - - - -
-
- +
+

+ Войти в систему +

+
+ + {title}
- ) +
+ + + + + + + {error && ( +
+ + {handleModalError(error)} + {/* setError(null)}*/} + {/*/>*/} + +
+ )} + +
+ + + + + +
+
+
+ ); }; diff --git a/src/components/SliderWorkers/SliderWorkers.js b/src/components/SliderWorkers/SliderWorkers.js index bd2b991e..56c1bff7 100644 --- a/src/components/SliderWorkers/SliderWorkers.js +++ b/src/components/SliderWorkers/SliderWorkers.js @@ -54,7 +54,7 @@ export const SliderWorkers = ({}) => { return (
-
+

{worker.skils}

diff --git a/src/components/SliderWorkers/sliderWorkers.scss b/src/components/SliderWorkers/sliderWorkers.scss index df84f434..2fc3bb5b 100644 --- a/src/components/SliderWorkers/sliderWorkers.scss +++ b/src/components/SliderWorkers/sliderWorkers.scss @@ -115,5 +115,32 @@ margin: 0; } } + + .slick-next, + .slick-prev { + display: none !important; + } + + .worker { + flex-direction: column; + margin: 0; + align-items: center; + + img { + margin: 0; + width: 50%; + } + + p { + margin-top: 10px; + text-align: center; + } + + .worker-description { + display: flex; + flex-direction: column; + align-items: center; + } + } } } diff --git a/src/pages/AuthForDevelopers/AuthForDevelopers.js b/src/pages/AuthForDevelopers/AuthForDevelopers.js index 8bc23163..64229ab0 100644 --- a/src/pages/AuthForDevelopers/AuthForDevelopers.js +++ b/src/pages/AuthForDevelopers/AuthForDevelopers.js @@ -11,7 +11,7 @@ import vector from "../../images/Vector_Smart_Object.png"; import vectorBlack from "../../images/Vector_Smart_Object_black.png"; import { selectAuth } from "../../redux/outstaffingSlice"; -import { useNavigate } from "react-router-dom"; +import { Link, useNavigate } from "react-router-dom"; import { Footer } from "../../components/Footer/Footer"; import SideBar from "../../components/SideBar/SideBar"; import AuthHeader from "../../components/AuthHeader/AuthHeader"; @@ -42,6 +42,16 @@ const AuthForDevelopers = () => { alt="" />
+
+ + + + + + +
diff --git a/src/pages/AuthForDevelopers/authForDevelopers.scss b/src/pages/AuthForDevelopers/authForDevelopers.scss index d80d60e8..26f843f4 100644 --- a/src/pages/AuthForDevelopers/authForDevelopers.scss +++ b/src/pages/AuthForDevelopers/authForDevelopers.scss @@ -23,6 +23,32 @@ right: -224px; } +.change-mode { + display: flex; + justify-content: center; + + &__partners { + width: 220px; + height: 50px; + background: #406128; + border-radius: 44px; + color: white; + font-size: 16px; + border: none; + margin-left: -40px; + } + + &__developers { + width: 220px; + height: 50px; + background-color: #52b709; + border-radius: 44px; + color: white; + font-size: 16px; + border: none; + } +} + @media (max-width: 575.98px) { .auth-developers__vector, .auth-developers__vector-black { diff --git a/src/pages/AuthForPartners/AuthForPartners.js b/src/pages/AuthForPartners/AuthForPartners.js index a18d637a..c3b0a219 100644 --- a/src/pages/AuthForPartners/AuthForPartners.js +++ b/src/pages/AuthForPartners/AuthForPartners.js @@ -7,7 +7,7 @@ import vector from "../../images/Vector_Smart_Object.png"; import vectorBlack from "../../images/Vector_Smart_Object_black.png"; import { useSelector } from "react-redux"; import { selectAuth } from "../../redux/outstaffingSlice"; -import { useNavigate } from "react-router-dom"; +import { Link, useNavigate } from "react-router-dom"; import { Footer } from "../../components/Footer/Footer"; import { AuthBox } from "../../components/AuthBox/AuthBox"; @@ -37,6 +37,16 @@ const AuthForPartners = () => {
+
+ + + + + + +
diff --git a/src/pages/AuthForPartners/authForPartners.scss b/src/pages/AuthForPartners/authForPartners.scss index 424b0198..3c3f56c5 100644 --- a/src/pages/AuthForPartners/authForPartners.scss +++ b/src/pages/AuthForPartners/authForPartners.scss @@ -49,6 +49,32 @@ padding-bottom: 310px; } +.change-mode { + display: flex; + justify-content: center; + + &__partners { + width: 220px; + height: 50px; + background: #406128; + border-radius: 44px; + color: white; + font-size: 16px; + border: none; + margin-left: -40px; + } + + &__developers { + width: 220px; + height: 50px; + background-color: #52b709; + border-radius: 44px; + color: white; + font-size: 16px; + border: none; + } +} + @media (max-width: 575.98px) { .auth-partners__info { max-width: 380px;