поставила тестовые маршруты на плашки нижней навигации и домашней страницы
This commit is contained in:
parent
5d75167fe8
commit
a8b87fbade
@ -5,7 +5,7 @@ import { useHistory, useLocation } from "react-router-dom";
|
|||||||
|
|
||||||
import { getRouteHome } from "../shared/consts/router";
|
import { getRouteHome } from "../shared/consts/router";
|
||||||
import { getRouteCourses } 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 { getRouteSettings } from "../shared/consts/router";
|
||||||
|
|
||||||
import { HomeIcon } from "./icons/HomeIcon";
|
import { HomeIcon } from "./icons/HomeIcon";
|
||||||
@ -21,7 +21,7 @@ const BottomNavigation: React.FC = () => {
|
|||||||
const navItems = [
|
const navItems = [
|
||||||
{ path: getRouteHome(), icon: HomeIcon, label: "Домой" },
|
{ path: getRouteHome(), icon: HomeIcon, label: "Домой" },
|
||||||
{ path: getRouteCourses(), icon: CalendarIcon, 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: "Меню" },
|
{ path: getRouteSettings(), icon: SettingsIcon, label: "Меню" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -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 uniqueDays = Array.from(new Set(course_exercises.map((ex) => ex.day))).sort((a, b) => a - b)
|
||||||
const dayMap: { [key: number]: number } = {}
|
const dayMap: { [key: number]: number } = {}
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ export const Exercise = () => {
|
|||||||
const selectedDay = new URLSearchParams(location.search).get("day")
|
const selectedDay = new URLSearchParams(location.search).get("day")
|
||||||
const fixedDay = selectedDay ? Number.parseInt(selectedDay) : 1
|
const fixedDay = selectedDay ? Number.parseInt(selectedDay) : 1
|
||||||
setCurrentDay(fixedDay)
|
setCurrentDay(fixedDay)
|
||||||
console.log("[v0] FIXED currentDay to:", fixedDay, "from URL parameter")
|
console.log(" FIXED currentDay to:", fixedDay, "from URL parameter")
|
||||||
|
|
||||||
if (exerciseIndex !== undefined) {
|
if (exerciseIndex !== undefined) {
|
||||||
let filteredExercises = exercises
|
let filteredExercises = exercises
|
||||||
|
@ -16,7 +16,7 @@ import { StatCardHome } from "../components/cards/StatCardHome";
|
|||||||
import { WorkoutCardHome } from "../components/cards/WorkoutCardHome";
|
import { WorkoutCardHome } from "../components/cards/WorkoutCardHome";
|
||||||
|
|
||||||
import { connect } from '../confconnect';
|
import { connect } from '../confconnect';
|
||||||
import { getRouteExercise } from "../shared/consts/router";
|
import { getRouteExerciseByIndex } from "../shared/consts/router";
|
||||||
import { getRouteCourses } from "../shared/consts/router";
|
import { getRouteCourses } from "../shared/consts/router";
|
||||||
import { getRouteCourseExercises } 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 overallProgress = courses.length > 0 ? Math.floor(Math.random() * 100) : 0
|
||||||
|
|
||||||
|
//пока передаю тестовые значения
|
||||||
|
|
||||||
const handleWorkoutClick = () => {
|
const handleWorkoutClick = () => {
|
||||||
history.push(getRouteExercise())
|
history.push(getRouteExerciseByIndex(1,1,1))
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleBackClick = () => {
|
const handleBackClick = () => {
|
||||||
@ -122,7 +124,7 @@ export default function Home() {
|
|||||||
|
|
||||||
const handleExercisesClick = () => {
|
const handleExercisesClick = () => {
|
||||||
if (courses.length > 0) {
|
if (courses.length > 0) {
|
||||||
history.push(getRouteCourseExercises(courses[0].ID.toString()))
|
history.push(getRouteCourseExercises(`${'1'}`))
|
||||||
} else {
|
} else {
|
||||||
history.push(getRouteCourses())
|
history.push(getRouteCourses())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user