Fixed auth page and tracker

This commit is contained in:
MaxOvs19
2023-03-27 19:08:01 +03:00
parent fc51fbdb09
commit 76334aec99
9 changed files with 86 additions and 20 deletions

View File

@ -1,6 +1,6 @@
import React, { useState } from "react";
import { useDispatch } from "react-redux";
import { setProject } from "../../../redux/projectsTrackerSlice";
import { setProject } from "../../../redux/projectsTrackerSlice";
import "./ModalCreate.scss";
@ -9,13 +9,17 @@ export const ModalCreate = ({ active, setActive, title }) => {
const dispatch = useDispatch();
function createName() {
let newItem = {
name: inputValue,
count: 0,
};
dispatch(setProject(newItem));
setActive(false);
setInputValue("")
if (inputValue === "") {
return;
} else {
let newItem = {
name: inputValue,
count: 0,
};
dispatch(setProject(newItem));
setActive(false);
setInputValue("");
}
}
return (