поставила тестовые маршруты на плашки нижней навигации и домашней страницы

This commit is contained in:
Tatyana 2025-09-05 16:33:00 +03:00
parent 5d75167fe8
commit a8b87fbade
4 changed files with 8 additions and 9 deletions

View File

@ -5,7 +5,7 @@ import { useHistory, useLocation } from "react-router-dom";
import { getRouteHome } from "../shared/consts/router";
import { getRouteCourses } from "../shared/consts/router";
import { getRouteCourseExercises } from "../shared/consts/router";
import { getRouteExerciseByIndex } from "../shared/consts/router";
import { getRouteSettings } from "../shared/consts/router";
import { HomeIcon } from "./icons/HomeIcon";
@ -21,7 +21,7 @@ const BottomNavigation: React.FC = () => {
const navItems = [
{ path: getRouteHome(), icon: HomeIcon, label: "Домой" },
{ path: getRouteCourses(), icon: CalendarIcon, label: "Курсы" },
{ path: getRouteCourseExercises(":id"), icon: DumbbellIcon, label: "Тренировка" },
{ path: getRouteExerciseByIndex(1,1,1), icon: DumbbellIcon, label: "Тренировка" },
{ path: getRouteSettings(), icon: SettingsIcon, label: "Меню" },
]

View File

@ -80,9 +80,6 @@ export const CourseExercises = () => {
const uniqueDays = Array.from(new Set(course_exercises.map((ex) => ex.day))).sort((a, b) => a - b)
const dayMap: { [key: number]: number } = {}

View File

@ -90,7 +90,7 @@ export const Exercise = () => {
const selectedDay = new URLSearchParams(location.search).get("day")
const fixedDay = selectedDay ? Number.parseInt(selectedDay) : 1
setCurrentDay(fixedDay)
console.log("[v0] FIXED currentDay to:", fixedDay, "from URL parameter")
console.log(" FIXED currentDay to:", fixedDay, "from URL parameter")
if (exerciseIndex !== undefined) {
let filteredExercises = exercises

View File

@ -16,7 +16,7 @@ import { StatCardHome } from "../components/cards/StatCardHome";
import { WorkoutCardHome } from "../components/cards/WorkoutCardHome";
import { connect } from '../confconnect';
import { getRouteExercise } from "../shared/consts/router";
import { getRouteExerciseByIndex } from "../shared/consts/router";
import { getRouteCourses } from "../shared/consts/router";
import { getRouteCourseExercises } from "../shared/consts/router";
@ -108,8 +108,10 @@ export default function Home() {
const overallProgress = courses.length > 0 ? Math.floor(Math.random() * 100) : 0
//пока передаю тестовые значения
const handleWorkoutClick = () => {
history.push(getRouteExercise())
history.push(getRouteExerciseByIndex(1,1,1))
}
const handleBackClick = () => {
@ -122,7 +124,7 @@ export default function Home() {
const handleExercisesClick = () => {
if (courses.length > 0) {
history.push(getRouteCourseExercises(courses[0].ID.toString()))
history.push(getRouteCourseExercises(`${'1'}`))
} else {
history.push(getRouteCourses())
}