diff --git a/src/App.jsx b/src/App.jsx index b2659cf..dd57b24 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -41,6 +41,7 @@ const App = () => { if (response.status === 200) { setUser(response.data); + console.log(response.data) globalRender(window.location.pathname, response.data, navigate); } else { diff --git a/src/assets/styles/components/myButton.module.scss b/src/assets/styles/components/myButton.module.scss index e2d45c6..3985573 100644 --- a/src/assets/styles/components/myButton.module.scss +++ b/src/assets/styles/components/myButton.module.scss @@ -8,6 +8,10 @@ border-radius: 5px; font-family: "Montserrat", sans-serif; } + &__red { + color: white; + background-color: rgb(235, 130, 130); + } &__green { color: white; background-color: rgb(150, 209, 158); diff --git a/src/pages/NewForm.jsx b/src/pages/NewForm.jsx index cba1e00..4df511a 100644 --- a/src/pages/NewForm.jsx +++ b/src/pages/NewForm.jsx @@ -190,16 +190,16 @@ const NewForm = () => { cleanStates(); }; - async function updateTitleForm() { - const response = await updateTitleFormApi(cookies.token, formId, newTitleForm); + // async function updateTitleForm() { + // const response = await updateTitleFormApi(cookies.token, formId, newTitleForm); - if (response.status === 200) { - console.log(response) - } - else { - console.log(response) - } - }; + // if (response.status === 200) { + // console.log(response) + // } + // else { + // console.log(response) + // } + // }; async function updateOrderBlock() { const response = await updateOrderBlockApi(cookies.token, formId, { @@ -220,15 +220,13 @@ const NewForm = () => { tListBlock.splice(dragElem, 1); }; - tListBlock.forEach((value, i) => tListBlock[i].order = i) - - setListBlock(tListBlock); + setListBlock(numberingBlocks(tListBlock, "order")); } }; async function saveForm() { if (oldTitleFrom !== newTitleForm) { - await updateTitleForm() + await updateTitleFormApi(cookies.token, formId, newTitleForm); } cleanStates(); diff --git a/src/pages/Profile.jsx b/src/pages/Profile.jsx index 4a08768..b2aad0b 100644 --- a/src/pages/Profile.jsx +++ b/src/pages/Profile.jsx @@ -108,19 +108,19 @@ const Profile = () => { Редактировать : Сохранить } - backgroundColor={edit ? "rgb(200, 200, 200)" : ""} + class={edit ? "main__white" : "main__green"} click={() => editUser()}/> :