diff --git a/VERSION b/VERSION index 9e36380..eca90f7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.18.4 +6.18.5 diff --git a/play-life-web/package.json b/play-life-web/package.json index 66d6540..42a2f81 100644 --- a/play-life-web/package.json +++ b/play-life-web/package.json @@ -1,6 +1,6 @@ { "name": "play-life-web", - "version": "6.18.4", + "version": "6.18.5", "type": "module", "scripts": { "dev": "vite", diff --git a/play-life-web/src/App.jsx b/play-life-web/src/App.jsx index c3a85b8..bc13f5b 100644 --- a/play-life-web/src/App.jsx +++ b/play-life-web/src/App.jsx @@ -1360,6 +1360,7 @@ function AppContent() { wishlistId={tabParams.wishlistId} returnTo={tabParams.returnTo} returnWishlistId={tabParams.returnWishlistId} + isActive={activeTab === 'task-form'} /> @@ -1389,6 +1390,7 @@ function AppContent() { editConditionIndex={tabParams.editConditionIndex} newTaskId={tabParams.newTaskId} boardId={tabParams.boardId} + isActive={activeTab === 'wishlist-form'} /> diff --git a/play-life-web/src/components/TaskForm.jsx b/play-life-web/src/components/TaskForm.jsx index 11bcd25..1f65d81 100644 --- a/play-life-web/src/components/TaskForm.jsx +++ b/play-life-web/src/components/TaskForm.jsx @@ -1,4 +1,5 @@ import React, { useState, useEffect, useRef } from 'react' +import { createPortal } from 'react-dom' import { useAuth } from './auth/AuthContext' import Toast from './Toast' import SubmitButton from './SubmitButton' @@ -8,7 +9,7 @@ import './TaskForm.css' const API_URL = '/api/tasks' const PROJECTS_API_URL = '/projects' -function TaskForm({ onNavigate, taskId, wishlistId, returnTo, returnWishlistId }) { +function TaskForm({ onNavigate, taskId, wishlistId, returnTo, returnWishlistId, isActive }) { const { authFetch } = useAuth() const [name, setName] = useState('') const [progressionBase, setProgressionBase] = useState('') @@ -885,6 +886,7 @@ function TaskForm({ onNavigate, taskId, wishlistId, returnTo, returnWishlistId } } return ( + <>
+ {isActive ? createPortal( +
+ + Сохранить + + {taskId && ( + + )} +
, + document.body + ) : null} + ) } diff --git a/play-life-web/src/components/WishlistForm.jsx b/play-life-web/src/components/WishlistForm.jsx index 834859a..083dac5 100644 --- a/play-life-web/src/components/WishlistForm.jsx +++ b/play-life-web/src/components/WishlistForm.jsx @@ -1,4 +1,5 @@ import React, { useState, useEffect, useCallback, useRef } from 'react' +import { createPortal } from 'react-dom' import Cropper from 'react-easy-crop' import { useAuth } from './auth/AuthContext' import Toast from './Toast' @@ -16,7 +17,7 @@ const TASKS_API_URL = '/api/tasks' const PROJECTS_API_URL = '/projects' const WISHLIST_FORM_STATE_KEY = 'wishlistFormPendingState' -function WishlistForm({ onNavigate, wishlistId, editConditionIndex, newTaskId: newTaskIdProp, boardId }) { +function WishlistForm({ onNavigate, wishlistId, editConditionIndex, newTaskId: newTaskIdProp, boardId, isActive }) { const { authFetch, user } = useAuth() // newTaskId может прийти из props (через onNavigate) или из sessionStorage (через history.back) @@ -791,6 +792,7 @@ function WishlistForm({ onNavigate, wishlistId, editConditionIndex, newTaskId: n } return ( + <>
-
{showConditionForm && ( @@ -1068,6 +1065,45 @@ function WishlistForm({ onNavigate, wishlistId, editConditionIndex, newTaskId: n )} + {isActive ? createPortal( +
+ +
, + document.body + ) : null} + ) }