This commit is contained in:
Николай Полтщук 2023-05-15 21:23:42 +03:00
parent 83f0c67017
commit 906dd0ec90
3 changed files with 8 additions and 20 deletions

View File

@ -20,17 +20,16 @@ export const TrackerModal = ({
defautlInput, defautlInput,
titleProject, titleProject,
projectId, projectId,
titleColumn
}) => { }) => {
const dispatch = useDispatch(); const dispatch = useDispatch();
const projectBoard = useSelector(getProjectBoard); const projectBoard = useSelector(getProjectBoard);
const modalType = useSelector(getValueModalType); const modalType = useSelector(getValueModalType);
const titleColumn = useSelector(getColumnTitle);
const [emailWorker, setEmailWorker] = useState(""); const [emailWorker, setEmailWorker] = useState("");
const [projectName, setProjectName] = useState(defautlInput); const [projectName, setProjectName] = useState(defautlInput);
const [editTitleColumn, setEditTitleColumn] = useState(""); const [editTitleColumn, setEditTitleColumn] = useState(titleColumn);
const [valueColumn, setValueColumn] = useState(""); const [valueColumn, setValueColumn] = useState("");
const [nameProject, setNameProject] = useState(""); const [nameProject, setNameProject] = useState("");
@ -242,19 +241,8 @@ export const TrackerModal = ({
<div className="title-project"> <div className="title-project">
<h4>Введите новое название</h4> <h4>Введите новое название</h4>
<div className="input-container"> <div className="input-container">
{/* {Boolean(projectBoard?.columns) &&
Boolean(projectBoard.columns.length) &&
projectBoard.columns.map((column) => {
// console.log(column.title);
// console.log("Lol" + titleColumn.title);
if (column.title === titleColumn) {
console.log(column.title);
}
})} */}
<input <input
className="name-project" className="name-project"
placeholder={titleColumn}
value={editTitleColumn} value={editTitleColumn}
onChange={(e) => setEditTitleColumn(e.target.value)} onChange={(e) => setEditTitleColumn(e.target.value)}
/> />

View File

@ -270,6 +270,12 @@ export const ProjectTracker = () => {
wrapperHover[column.id] ? "tasks__board__hover" : "" wrapperHover[column.id] ? "tasks__board__hover" : ""
}`} }`}
> >
<TrackerModal
active={modalAdd}
setActive={setModalAdd}
selectedTab={selectedTab}
titleColumn={column.title}
/>
<div className="board__head"> <div className="board__head">
{/*<span className={wrapperIndex === 3 ? "done" : ""}>*/} {/*<span className={wrapperIndex === 3 ? "done" : ""}>*/}
<span>{column.title}</span> <span>{column.title}</span>
@ -303,7 +309,6 @@ export const ProjectTracker = () => {
[column.id]: false, [column.id]: false,
})); }));
dispatch(modalToggle("editColumn")); dispatch(modalToggle("editColumn"));
dispatch(setColumnTitle(column.title));
setModalAdd(true); setModalAdd(true);
}} }}
> >

View File

@ -6,7 +6,6 @@ const initialState = {
projectBoard: {}, projectBoard: {},
toggleTab: 1, toggleTab: 1,
modalType: "", modalType: "",
titleColumn: "",
boardLoader: false, boardLoader: false,
}; };
@ -66,9 +65,6 @@ export const projectsTrackerSlice = createSlice({
modalToggle: (state, action) => { modalToggle: (state, action) => {
state.modalType = action.payload; state.modalType = action.payload;
}, },
setColumnTitle: (state, action) => {
state.titleColumn = action.payload;
},
}, },
extraReducers: { extraReducers: {
[setProjectBoardFetch.fulfilled]: (state, action) => { [setProjectBoardFetch.fulfilled]: (state, action) => {
@ -94,7 +90,6 @@ export const getProjects = (state) => state.tracker.projects;
export const getProjectBoard = (state) => state.tracker.projectBoard; export const getProjectBoard = (state) => state.tracker.projectBoard;
export const getToggleTab = (state) => state.tracker.toggleTab; export const getToggleTab = (state) => state.tracker.toggleTab;
export const getValueModalType = (state) => state.tracker.modalType; export const getValueModalType = (state) => state.tracker.modalType;
export const getColumnTitle = (state) => state.tracker.titleColumn;
export const getBoarderLoader = (state) => state.tracker.boardLoader; export const getBoarderLoader = (state) => state.tracker.boardLoader;
export default projectsTrackerSlice.reducer; export default projectsTrackerSlice.reducer;