registration

This commit is contained in:
Mikola 2023-11-05 20:42:03 +03:00
parent 321b84a80e
commit 59fde487ea
6 changed files with 29 additions and 15 deletions

View File

@ -33,8 +33,8 @@ export const ModalRegistration = ({ active, setActive }) => {
userName: "", userName: "",
email: "", email: "",
password: "", password: "",
}) });
} };
const { showNotification } = useNotification(); const { showNotification } = useNotification();
const submitHandler = () => { const submitHandler = () => {
@ -47,7 +47,7 @@ export const ModalRegistration = ({ active, setActive }) => {
}, },
}).then(() => { }).then(() => {
setActive(false); setActive(false);
resetInputsValue() resetInputsValue();
showNotification({ showNotification({
show: true, show: true,
text: "Аккаунт успешно создан", text: "Аккаунт успешно создан",

View File

@ -77,7 +77,11 @@ export const Navigation = () => {
return; return;
} }
apiRequest(`/user/me`).then((profileInfo) => apiRequest(`/user/me`).then((profileInfo) =>
dispatch(setProfileInfo(profileInfo.userCard ? profileInfo.userCard : profileInfo)) dispatch(
setProfileInfo(
profileInfo.userCard ? profileInfo.userCard : profileInfo
)
)
); );
}, [dispatch]); }, [dispatch]);

View File

@ -22,8 +22,9 @@ import { Navigation } from "@components/Navigation/Navigation";
import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs"; import { ProfileBreadcrumbs } from "@components/ProfileBreadcrumbs/ProfileBreadcrumbs";
import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader"; import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
import { ProfileCalendarComponent } from "./ProfileCalendarComponent";
import avatarMok from "assets/images/avatarMok.png"; import avatarMok from "assets/images/avatarMok.png";
import { ProfileCalendarComponent } from "./ProfileCalendarComponent";
import "./profileCalendar.scss"; import "./profileCalendar.scss";
export const ProfileCalendar = () => { export const ProfileCalendar = () => {
@ -102,7 +103,8 @@ export const ProfileCalendar = () => {
alt="avatar" alt="avatar"
/> />
<p className="summary__name"> <p className="summary__name">
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}, {profileInfo.specification} разработчик {profileInfo?.fio ? profileInfo?.fio : profileInfo?.username},{" "}
{profileInfo.specification} разработчик
</p> </p>
</div> </div>
<Link to="/report"> <Link to="/report">

View File

@ -2,7 +2,7 @@ import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux"; import { useDispatch, useSelector } from "react-redux";
import { NavLink, useNavigate } from "react-router-dom"; import { NavLink, useNavigate } from "react-router-dom";
import {auth, getProfileInfo, setProfileInfo} from "@redux/outstaffingSlice"; import { auth, getProfileInfo, setProfileInfo } from "@redux/outstaffingSlice";
import { getRole } from "@redux/roleSlice"; import { getRole } from "@redux/roleSlice";
import { apiRequest } from "@api/request"; import { apiRequest } from "@api/request";
@ -30,7 +30,11 @@ export const ProfileHeader = () => {
return; return;
} }
apiRequest(`/user/me`).then((profileInfo) => { apiRequest(`/user/me`).then((profileInfo) => {
dispatch(setProfileInfo(profileInfo.userCard ? profileInfo.userCard : profileInfo)) dispatch(
setProfileInfo(
profileInfo.userCard ? profileInfo.userCard : profileInfo
)
);
}); });
}, [dispatch]); }, [dispatch]);

View File

@ -121,7 +121,8 @@ export const Profile = () => {
<p className="summary__name"> <p className="summary__name">
{user === "developer" ? ( {user === "developer" ? (
<span> <span>
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}, {profileInfo?.specification} разработчик {profileInfo?.fio ? profileInfo?.fio : profileInfo?.username},{" "}
{profileInfo?.specification} разработчик
</span> </span>
) : ( ) : (
"ООО НДВ Консалтинг" "ООО НДВ Консалтинг"

View File

@ -16,9 +16,9 @@ import { ProfileHeader } from "@components/ProfileHeader/ProfileHeader";
import rightArrow from "assets/icons/arrows/arrowRight.svg"; import rightArrow from "assets/icons/arrows/arrowRight.svg";
import arrow from "assets/icons/arrows/left-arrow.png"; import arrow from "assets/icons/arrows/left-arrow.png";
import gitImgItem from "assets/icons/gitItemImg.svg"; import gitImgItem from "assets/icons/gitItemImg.svg";
import avatarMok from "assets/images/avatarMok.png";
import "./summary.scss"; import "./summary.scss";
import avatarMok from "assets/images/avatarMok.png";
export const Summary = () => { export const Summary = () => {
if (localStorage.getItem("role_status") === "18") { if (localStorage.getItem("role_status") === "18") {
@ -58,13 +58,16 @@ export const Summary = () => {
<div className="summary__person"> <div className="summary__person">
<img <img
src={ src={
profileInfo?.photo ? urlForLocal(profileInfo.photo) : avatarMok profileInfo?.photo
? urlForLocal(profileInfo.photo)
: avatarMok
} }
className="summary__avatar" className="summary__avatar"
alt="avatar" alt="avatar"
/> />
<p className="summary__name"> <p className="summary__name">
{profileInfo?.fio ? profileInfo?.fio : profileInfo?.username}, {profileInfo.specification} разработчик {profileInfo?.fio ? profileInfo?.fio : profileInfo?.username},{" "}
{profileInfo.specification} разработчик
</p> </p>
</div> </div>
{!openGit && ( {!openGit && (