diff --git a/package.json b/package.json index e91a7f4..08d58e7 100644 --- a/package.json +++ b/package.json @@ -38,10 +38,14 @@ "@uiw/react-markdown-editor": "^5.12.1", "axios": "^1.6.8", "bootstrap": "^5.3.3", + "inputmask": "^5.0.9", + "primereact": "^10.6.6", + "qrcode": "^1.5.3", "react": "^18.2.0", "react-bootstrap": "^2.10.1", "react-cookie": "^7.1.4", "react-dom": "^18.2.0", + "react-qr-code": "^2.0.15", "react-router-dom": "^6.22.1" } } diff --git a/src/App.jsx b/src/App.jsx index 42f840b..c2a7d91 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useLayoutEffect } from "react"; +import React, { useState, useEffect, useLayoutEffect, useRef } from "react"; import { Outlet, useNavigate } from "react-router-dom"; import { FormsData, UserData, TypeAnswerData, answersData } from "./context"; import { useCookies } from "react-cookie"; @@ -20,6 +20,9 @@ const App = () => { const navigate = useNavigate(); const [forms, setForms] = useState([]); const [user, setUser] = useState(false); + globalRender(window.location.pathname, user, navigate); + + const userRef = useRef(false) const [answersList, setAnswersList] = useState([]); const [listTypeAnswer, setListTypeAnswer] = useState([ {id: 1, text: 'Краткий ответ', typeTag: InputText}, @@ -37,13 +40,16 @@ const App = () => { useEffect(() => { async function verifyUser() { const response = await verifyUserApi(cookies.token); + console.log("verifyUser App") if (response.status === 200) { setUser(response.data); - globalRender(window.location.pathname, response.data, navigate); + userRef.current = response.data + // globalRender(window.location.pathname, response.data, navigate); } else { - globalRender(window.location.pathname, false, navigate); + // globalRender(window.location.pathname, false, navigate); + setUser(false); } } @@ -51,7 +57,7 @@ const App = () => { }, []); return ( - + { return ( @@ -45,13 +46,15 @@ const AnswerModal = ({
Вопрос + + setFile(event.target.value)} + onChange={e => addFiles(e.target.files)} >
diff --git a/src/components/DefaultModal.jsx b/src/components/DefaultModal.jsx index a839f27..f08be0d 100644 --- a/src/components/DefaultModal.jsx +++ b/src/components/DefaultModal.jsx @@ -5,14 +5,13 @@ import MyButton from "./MyButton.jsx"; const DefaultModal = ({ name, - postfix, btn, BodyModal }) => { return (