From 5bc35a3ced5cc42630e69fecdcac8007534bfa28 Mon Sep 17 00:00:00 2001 From: Nickolai Date: Mon, 19 Aug 2024 04:35:46 +0400 Subject: [PATCH] fix/before deploy --- README.md | 4 ++-- src/components/App/App.tsx | 11 ++++----- src/components/Filter/Filter.tsx | 1 - src/components/SideBar/SideBar.tsx | 8 +++---- src/pages/Employees/Employees.tsx | 2 +- src/pages/Main/Main.tsx | 2 +- src/pages/Registration/Registration.tsx | 12 +++++----- src/store/features/slice/userSlice.ts | 30 +++++++++++++++++++++++-- src/ui/FilterList/FilterList.tsx | 22 ++++-------------- src/ui/Modal/Modal.tsx | 5 ++--- 10 files changed, 54 insertions(+), 43 deletions(-) diff --git a/README.md b/README.md index 7ed8cba..52d7b8d 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ # Проект "Gazprom" Задача: создание MVP Системы управления организационной структурой. Целью проведения Конкурса является: -● Поддержка и развитие IT-сообщества, -● Разработка сервиса Соорганизатора +- Поддержка и развитие IT-сообщества, +- Разработка сервиса Соорганизатора [**Ссылка на сайт**](https://gazprom.hopto.org) diff --git a/src/components/App/App.tsx b/src/components/App/App.tsx index 69d6d8b..d5b5648 100644 --- a/src/components/App/App.tsx +++ b/src/components/App/App.tsx @@ -5,22 +5,23 @@ import { Outlet, useNavigate } from 'react-router-dom'; import { useEffect, useState } from 'react'; import { useAppDispatch, useAppSelector } from 'src/store/hooks'; import Registration from 'src/pages/Registration/Registration'; +import Preloader from 'src/ui/Preloader/Preloader'; +import { fetchGetTeamsId } from 'src/store/features/slice/teamsSlice'; +import { id } from 'src/services/const'; +import { selectMembers } from 'src/store/features/slice/membersSlice'; +import { membersProps, RegisterDataProps } from 'src/services/types'; import { allowDrop, handleDragStart, handleDrop, } from 'src/services/dragAndDrop'; -import { selectMembers } from 'src/store/features/slice/membersSlice'; -import { membersProps, RegisterDataProps } from 'src/services/types'; import { fetchRegisterUser, selectUsers, setLoading, setLoggedIn, } from 'src/store/features/slice/userSlice'; -import Preloader from 'src/ui/Preloader/Preloader'; -import { fetchGetTeamsId } from 'src/store/features/slice/teamsSlice'; -import { id } from 'src/services/const'; + export default function App() { const { loggedIn, loading } = useAppSelector(selectUsers); diff --git a/src/components/Filter/Filter.tsx b/src/components/Filter/Filter.tsx index fbe26c6..ccd28ac 100644 --- a/src/components/Filter/Filter.tsx +++ b/src/components/Filter/Filter.tsx @@ -20,7 +20,6 @@ interface FilterProps { export default function Filter({ droppedCards }: FilterProps) { const { isFilterOpen } = useAppSelector(selectMembers); - const { members, currentPage } = useAppSelector(selectMembers); const dispatch = useAppDispatch(); diff --git a/src/components/SideBar/SideBar.tsx b/src/components/SideBar/SideBar.tsx index ae3d81d..baa866e 100644 --- a/src/components/SideBar/SideBar.tsx +++ b/src/components/SideBar/SideBar.tsx @@ -1,5 +1,4 @@ import { Button } from 'antd'; -import { useState } from 'react'; import styles from 'src/components/SideBar/SideBar.module.scss'; import cn from 'classnames/bind'; import { motion } from 'framer-motion'; @@ -24,13 +23,14 @@ import { setIsFilterOpen, setShortWindow, } from 'src/store/features/slice/membersSlice'; +import { selectUsers, setShorMore } from 'src/store/features/slice/userSlice'; const cx = cn.bind(styles); export default function SideBar() { const { shortWindow } = useAppSelector(selectMembers); + const { showMore } = useAppSelector(selectUsers); const dispatch = useAppDispatch(); - const [showMore, setShorMore] = useState(true); const location = useLocation(); const navigate = useNavigate(); const newTeamRout = location.pathname === '/new-team'; @@ -70,7 +70,7 @@ export default function SideBar() { ), text: 'Справочник', - onClick: () => setShorMore(!showMore), + onClick: () => dispatch(setShorMore(!showMore)), }, ].map((item, index) => item.link ? ( @@ -103,7 +103,7 @@ export default function SideBar() {
  • setShorMore(!showMore)} + onClick={() => dispatch(setShorMore(!showMore))} > {item.icon} void; } export default function Registration({ handleRegister }: RegistrationProps) { - - const [email, setEmail] = useState(''); - const [password, setPassword] = useState(''); + const { email, password } = useAppSelector(selectUsers); + const dispatch = useAppDispatch(); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); @@ -26,14 +26,14 @@ export default function Registration({ handleRegister }: RegistrationProps) { setEmail(e.target.value)} + onChange={(e) => dispatch(setEmail(e.target.value))} placeholder='Логин' > setPassword(e.target.value)} + onChange={(e) => dispatch(setPassword(e.target.value))} placeholder='Введите пароль' >