active links in nav, delete report, loaders in report, changes routes

This commit is contained in:
Mikola
2024-02-07 18:54:21 +03:00
parent 455be87e26
commit b75b846335
13 changed files with 91 additions and 108 deletions

View File

@ -87,10 +87,12 @@ const ReportForm = () => {
};
const handler = () => {
setIsFetching(true)
for (let input of inputs) {
if (!input.task || !input.hours_spent) {
setReportSuccess("Заполните задачи");
setTimeout(() => setReportSuccess(""), 2000);
setIsFetching(false)
return;
}
}
@ -292,12 +294,15 @@ const ReportForm = () => {
<div className="row">
<div className="col-12">
<div className="report-form__footer">
<button
className="report-form__footer-btn"
onClick={() => handler()}
>
{isFetching ? <Loader /> : "Отправить"}
</button>
{isFetching ?
<Loader style={'green'} /> :
<button
className="report-form__footer-btn"
onClick={() => handler()}
>
Отпаравить
</button>
}
<p className="report-form__footer-text">
Всего за день:{" "}
<span>