From b2c95dcbab8a4e44471bd52ad5662167d0106943 Mon Sep 17 00:00:00 2001 From: poignatov Date: Tue, 20 Jan 2026 21:02:22 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B1=D1=8D=D0=B9=D0=B4=D0=B6=D0=B5=D0=B9?= =?UTF-8?q?=20=D0=B7=D0=B0=D0=B4=D0=B0=D1=87=20=D0=B8=20=D1=83=D0=BB=D1=83?= =?UTF-8?q?=D1=87=D1=88=D0=B5=D0=BD=D0=B8=D1=8F=20wishlist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION | 2 +- play-life-web/package.json | 2 +- play-life-web/src/components/TaskList.css | 2 +- play-life-web/src/components/TaskList.jsx | 81 ++++++++-------- .../src/components/WishlistDetail.css | 40 +++++++- .../src/components/WishlistDetail.jsx | 97 +++++++++++-------- 6 files changed, 138 insertions(+), 86 deletions(-) diff --git a/VERSION b/VERSION index ee893b7..954e228 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.23.0 +3.24.0 diff --git a/play-life-web/package.json b/play-life-web/package.json index a6e7ada..6c920d6 100644 --- a/play-life-web/package.json +++ b/play-life-web/package.json @@ -1,6 +1,6 @@ { "name": "play-life-web", - "version": "3.23.0", + "version": "3.24.0", "type": "module", "scripts": { "dev": "vite", diff --git a/play-life-web/src/components/TaskList.css b/play-life-web/src/components/TaskList.css index 7d87720..b082823 100644 --- a/play-life-web/src/components/TaskList.css +++ b/play-life-web/src/components/TaskList.css @@ -149,7 +149,7 @@ flex-shrink: 0; } -.task-onetime-icon { +.task-recurring-icon { color: #9ca3af; flex-shrink: 0; } diff --git a/play-life-web/src/components/TaskList.jsx b/play-life-web/src/components/TaskList.jsx index ed7c4be..f1b3bda 100644 --- a/play-life-web/src/components/TaskList.jsx +++ b/play-life-web/src/components/TaskList.jsx @@ -602,43 +602,9 @@ function TaskList({ onNavigate, data, loading, backgroundLoading, error, onRetry (+{task.subtasks_count}) )} - {hasProgression && ( - - - - - )} - {isInfinite && ( - - - - - )} - {isOneTime && !isWishlist && ( + {!isOneTime && !isInfinite && !isWishlist && ( - - - + + + + + + )} + {isInfinite && ( + + + + + )} + {hasProgression && ( + + + )} diff --git a/play-life-web/src/components/WishlistDetail.css b/play-life-web/src/components/WishlistDetail.css index 6c7b07c..cc31be8 100644 --- a/play-life-web/src/components/WishlistDetail.css +++ b/play-life-web/src/components/WishlistDetail.css @@ -291,12 +291,13 @@ } .wishlist-detail-uncomplete-button { - background-color: #f39c12; + flex: 1; + background-color: #f1c40f; color: white; } .wishlist-detail-uncomplete-button:hover:not(:disabled) { - background-color: #e67e22; + background-color: #f39c12; transform: translateY(-1px); } @@ -320,6 +321,41 @@ cursor: not-allowed; } +.wishlist-detail-bottom-actions { + position: fixed; + bottom: 0; + left: 0; + right: 0; + padding: 1rem; + background: white; + border-top: 1px solid #e5e7eb; + box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1); + z-index: 1500; +} + +.wishlist-detail-bottom-actions .wishlist-detail-uncomplete-button { + flex: 1; + padding: 0.75rem 1.5rem; + border: none; + border-radius: 6px; + font-size: 1rem; + font-weight: 500; + cursor: pointer; + transition: all 0.2s; + background-color: #f1c40f; + color: white; +} + +.wishlist-detail-bottom-actions .wishlist-detail-uncomplete-button:hover:not(:disabled) { + background-color: #f39c12; + transform: translateY(-1px); +} + +.wishlist-detail-bottom-actions .wishlist-detail-uncomplete-button:disabled { + opacity: 0.6; + cursor: not-allowed; +} + .loading { text-align: center; padding: 2rem; diff --git a/play-life-web/src/components/WishlistDetail.jsx b/play-life-web/src/components/WishlistDetail.jsx index be35598..d4046e3 100644 --- a/play-life-web/src/components/WishlistDetail.jsx +++ b/play-life-web/src/components/WishlistDetail.jsx @@ -91,7 +91,7 @@ function WishlistDetail({ wishlistId, onNavigate, onRefresh, boardId }) { }) if (!response.ok) { - throw new Error('Ошибка при отмене завершения') + throw new Error('Ошибка при возобновлении желания') } if (onRefresh) { @@ -100,7 +100,7 @@ function WishlistDetail({ wishlistId, onNavigate, onRefresh, boardId }) { fetchWishlistDetail() } catch (err) { console.error('Error uncompleting wishlist:', err) - setToastMessage({ text: err.message || 'Ошибка при отмене завершения', type: 'error' }) + setToastMessage({ text: err.message || 'Ошибка при возобновлении желания', type: 'error' }) } finally { setIsCompleting(false) } @@ -172,7 +172,7 @@ function WishlistDetail({ wishlistId, onNavigate, onRefresh, boardId }) { const handleDeleteTask = async (e) => { e.stopPropagation() - if (!wishlistItem?.linked_task) return + if (!wishlistItem?.linked_task || wishlistItem?.completed) return if (!window.confirm('Удалить задачу, связанную с желанием?')) { return @@ -367,7 +367,7 @@ function WishlistDetail({ wishlistId, onNavigate, onRefresh, boardId }) { {renderUnlockConditions()} {/* Связанная задача или кнопки действий */} - {wishlistItem.unlocked && !wishlistItem.completed && ( + {wishlistItem.unlocked && ( <> {wishlistItem.linked_task && wishlistItem.linked_task.user_id === user?.id ? (
@@ -397,25 +397,25 @@ function WishlistDetail({ wishlistId, onNavigate, onRefresh, boardId }) { const showDate = new Date(wishlistItem.linked_task.next_show_at) // Нормализуем дату: устанавливаем время в 00:00:00 в локальном времени const showDateNormalized = new Date(showDate.getFullYear(), showDate.getMonth(), showDate.getDate()) - + const today = new Date() const todayNormalized = new Date(today.getFullYear(), today.getMonth(), today.getDate()) - + // Показываем только если дата > сегодня if (showDateNormalized.getTime() <= todayNormalized.getTime()) { return null } - + const tomorrowNormalized = new Date(todayNormalized) tomorrowNormalized.setDate(tomorrowNormalized.getDate() + 1) - + let dateText if (showDateNormalized.getTime() === tomorrowNormalized.getTime()) { dateText = 'Завтра' } else { dateText = showDate.toLocaleDateString('ru-RU', { day: 'numeric', month: 'long', year: 'numeric' }) } - + return (
{dateText} @@ -424,43 +424,57 @@ function WishlistDetail({ wishlistId, onNavigate, onRefresh, boardId }) { })()}
-
- -
+ {wishlistItem && !wishlistItem.completed && ( +
+ +
+ )} ) : (
- - + {wishlistItem.completed ? ( + + ) : ( + <> + + + + )}
)} @@ -468,6 +482,7 @@ function WishlistDetail({ wishlistId, onNavigate, onRefresh, boardId }) { )} + {toastMessage && (