active links in nav, delete report, loaders in report, changes routes
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user