diff --git a/config/webpack.dev.js b/config/webpack.dev.js index 972ea2752..2432f7188 100644 --- a/config/webpack.dev.js +++ b/config/webpack.dev.js @@ -13,12 +13,12 @@ module.exports = { open: true, port: "3000", historyApiFallback: true, - // https: { + https: { // DEV.NOTE: uncomment and change names of files according to your generated ones - // key: fs.readFileSync("cert\\localhost+1-key.pem"), - // cert: fs.readFileSync("cert\\localhost+1.pem"), - // }, + key: fs.readFileSync("cert/localhost+1-key.pem"), + cert: fs.readFileSync("cert/localhost+1.pem"), + }, }, module: { rules: require("./webpack.rules"), diff --git a/src/features/AdminPage/TeamPage/TeamModal/TeamModal.component.tsx b/src/features/AdminPage/TeamPage/TeamModal/TeamModal.component.tsx index 2b549b713..1f56bc85d 100644 --- a/src/features/AdminPage/TeamPage/TeamModal/TeamModal.component.tsx +++ b/src/features/AdminPage/TeamPage/TeamModal/TeamModal.component.tsx @@ -51,6 +51,7 @@ const TeamModal: React.FC<{ const [actionSuccess, setActionSuccess] = useState(false); const [waitingForApiResponse, setWaitingForApiResponse] = useState(false); const imageId = useRef(0); + const [isSaveButtonDisabled, setIsSaveButtonDisabled] = useState(true); message.config({ top: 100, @@ -146,6 +147,7 @@ const TeamModal: React.FC<{ const closeModal = () => { if (!waitingForApiResponse) { setIsModalOpen(false); + setIsSaveButtonDisabled(true); } }; @@ -170,7 +172,7 @@ const TeamModal: React.FC<{ } else { const newId = getNewId(teamSourceLinks); const isLogoTypePresent = teamSourceLinks.some(obj => obj.logoType === Number(LogoType[logotype])); - + if(isLogoTypePresent){ setExistWarningVisible(true); } @@ -181,7 +183,7 @@ const TeamModal: React.FC<{ targetUrl: url, }]); } - + } }; @@ -194,6 +196,7 @@ const TeamModal: React.FC<{ await form.validateFields(); setWaitingForApiResponse(true); await form.submit(); + setIsSaveButtonDisabled(true); } catch (error) { message.error("Будь ласка, заповніть всі обов'язкові поля та перевірте валідність ваших даних"); } @@ -246,8 +249,13 @@ const TeamModal: React.FC<{ const handleCheckboxChange = (e: { target: { checked: boolean | ((prevState: boolean) => boolean); }; }) => { setIsMain(e.target.checked); + handleInputChange(); }; + const handleInputChange = () => { + setIsSaveButtonDisabled(false); + } + return ( - + @@ -298,6 +306,7 @@ const TeamModal: React.FC<{ mode="tags" onDeselect={onPositionDeselect} value={selectedPositions.map((x) => x.position)} + onChange={handleInputChange} > {positions.map((t) =>