-
-
{item.block.map((block, i) =>
diff --git a/src/pages/Forms.jsx b/src/pages/Forms.jsx
index ed5aac9..d57e9ca 100644
--- a/src/pages/Forms.jsx
+++ b/src/pages/Forms.jsx
@@ -14,6 +14,7 @@ const Forms = () => {
const {user, setUser} = useContext(UserData);
const [stateLoading, setStateLoading] = useState(false);
const [removeIdForm, setRemoveIdForm] = useState(false);
+ const [searchForm, setSearchForm] = useState("");
const [cookies, _, __] = useCookies(["user"]);
@@ -89,11 +90,13 @@ const Forms = () => {
}
};
+ const filterFormsBySearch = () => [...forms].filter(item => item.title.toLowerCase().includes(searchForm))
+
return (
- {/*
*/}
+
Загрузка...
@@ -107,7 +110,7 @@ const Forms = () => {
Изменения
*/}
- {forms.map((item, i) =>
+ {filterFormsBySearch().map((item, i) =>
editForm(item)}>{item.title}
{/*
{item.datetime}
diff --git a/src/pages/NewForm.jsx b/src/pages/NewForm.jsx
index ed9f6c9..664c8f1 100644
--- a/src/pages/NewForm.jsx
+++ b/src/pages/NewForm.jsx
@@ -225,12 +225,6 @@ const NewForm = () => {
Название формы
setNewTitleForm(event.target.value)}/>
- {/*
}
- click={() => updateTitleForm()}
- class={"main__green"}
- otherStyle={{paddingLeft: "0.9rem", paddingRight: "0.9rem"}}>
- */}