From 1de8b09cce0a90e1b1bfd3c27e549ee4bab8d172 Mon Sep 17 00:00:00 2001 From: Tatyana Date: Tue, 9 Sep 2025 14:20:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B7=D0=B0=D0=BF=D1=80=D0=B5=D1=89=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=BE=D0=B4=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D0=BA=D0=BB=D0=B8=D0=BA=D1=83=20=D0=BD=D0=B0=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B2=D0=B5=D1=80=D1=88=D0=B5=D0=BD=D0=BD=D0=BE=D0=B5=20?= =?UTF-8?q?=D1=83=D0=BF=D1=80=D0=B0=D0=B6=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/CourseExercises.tsx | 14 ++--- src/pages/Exercise.tsx | 105 ++++++++++++++++++++++------------ 2 files changed, 74 insertions(+), 45 deletions(-) diff --git a/src/pages/CourseExercises.tsx b/src/pages/CourseExercises.tsx index e23117e..97bde4d 100644 --- a/src/pages/CourseExercises.tsx +++ b/src/pages/CourseExercises.tsx @@ -138,11 +138,10 @@ export const CourseExercises = () => { onClick={() => { setSelectedDay(day) }} - className={`flex-shrink-0 px-4 py-2 rounded-full text-xs sm:text-sm font-semibold transition-all duration-300 inline-block ${ - selectedDay === day + className={`flex-shrink-0 px-4 py-2 rounded-full text-xs sm:text-sm font-semibold transition-all duration-300 inline-block ${selectedDay === day ? "bg-[#2BACBE] text-white shadow-lg" : "bg-white text-gray-600 hover:bg-gray-100" - }`} + }`} > День {daysNav[index]} @@ -161,11 +160,12 @@ export const CourseExercises = () => {
{ - history.push(getRouteExerciseByIndex(item.id_course.toString(), index, selectedDay || undefined)) + if (!isCompleted) { + history.push(getRouteExerciseByIndex(item.id_course.toString(), index, selectedDay || undefined)); + } }} - className={`p-4 mb-4 cursor-pointer hover:scale-105 transition duration-300 glass-morphism rounded-3xl border border-white/50 shadow-2xl overflow-hidden backdrop-blur-2xl relative ${ - isCompleted ? "opacity-60 bg-gray-100/50" : "" - }`} + className={`p-4 mb-4 cursor-pointer hover:scale-105 transition duration-300 glass-morphism rounded-3xl border border-white/50 shadow-2xl overflow-hidden backdrop-blur-2xl relative ${isCompleted ? "opacity-60 bg-gray-100/50 cursor-default" : "cursor-pointer" + }`} >
diff --git a/src/pages/Exercise.tsx b/src/pages/Exercise.tsx index 9b2b076..658e778 100644 --- a/src/pages/Exercise.tsx +++ b/src/pages/Exercise.tsx @@ -699,22 +699,32 @@ export const Exercise = () => { title: "Описание упражнения", description: exercise?.desc || "Выполните упражнение согласно инструкции.", }, + { - title: "Продолжительность", - description: `Время выполнения: ${exercise?.time || 15} минут`, - }, - { - title: "Подходы и повторения", + title: "Подходы", description: `Выполните ${exercise?.count || 1} подход по ${exercise?.repeats || 12} повторений с отдыхом 60 секунд между подходами.`, }, { - title: "Позиция в программе", - description: `Это упражнение №${exercise?.position || 1} в программе дня ${exercise?.day || 1}.`, + title: "Динамика", + description: "Добавить.", + }, + { + title: "Статика", + description: "Добавить", + }, + { + title: "Отдых", + description: "Добавить.", + }, + { + title: "Продолжительность", + description: `Время выполнения: ${exercise?.time || 5} минут`, }, { title: "Техника безопасности", description: "Следите за правильной техникой выполнения. При появлении боли немедленно прекратите упражнение.", }, + ] // ========== ЭКРАНЫ ЗАГРУЗКИ И ОШИБОК ========== @@ -806,11 +816,10 @@ export const Exercise = () => { @@ -865,9 +874,8 @@ export const Exercise = () => { return (
{setNumber}
@@ -881,34 +889,58 @@ export const Exercise = () => {
-
- {exerciseSteps.map((step, index) => ( -
-
-
-

{step.title}

-

{step.description}

-
+
+ {exerciseSteps.map((step, index) => { + // Проверяем, если текущий элемент "Динамика", отрендерим карточку с двумя блоками ("Динамика" + "Статика") + if (step.title === "Динамика" && exerciseSteps[index + 1]?.title === "Статика") { + return ( +
+
+ {[step, exerciseSteps[index + 1]].map((subStep, subIndex) => ( +
+

{subStep.title}

+

{subStep.description}

-
- ))} + ))} +
+ ); + } + // Пропускаем элемент "Статика", т.к. он уже отрендерен вместе с "Динамика" + if (step.title === "Статика") { + return null; + } + // Для остальных - рендер стандартный + return ( +
+
+
+

{step.title}

+

{step.description}

+
+
+
+ ); + })} +
{isCompleted @@ -925,13 +957,12 @@ export const Exercise = () => {
@@ -958,11 +989,10 @@ export const Exercise = () => { setIsRestPaused(!isRestPaused) handlePause(completedSets, currentSet, true, restTime, !isRestPaused) }} - className={`flex-1 font-bold py-3 px-4 rounded-xl transition-all duration-300 flex items-center justify-center space-x-2 ${ - isRestPaused + className={`flex-1 font-bold py-3 px-4 rounded-xl transition-all duration-300 flex items-center justify-center space-x-2 ${isRestPaused ? "bg-yellow-500 hover:bg-yellow-600 text-white" : "bg-[#2BACBE] hover:bg-[#2099A8] text-white" - }`} + }`} > {isRestPaused ? ( <> @@ -990,11 +1020,10 @@ export const Exercise = () => { setIsPlaying(false) } }} - className={`flex-1 font-bold py-3 px-4 rounded-xl transition-all duration-300 transform hover:scale-105 flex items-center justify-center space-x-2 cursor-pointer ${ - isPlaying + className={`flex-1 font-bold py-3 px-4 rounded-xl transition-all duration-300 transform hover:scale-105 flex items-center justify-center space-x-2 cursor-pointer ${isPlaying ? "bg-yellow-500 hover:bg-yellow-600 text-white shadow-lg" : "bg-[#2BACBE] hover:bg-[#2099A8] text-white shadow-lg" - }`} + }`} > {isPlaying ? ( <>