From b2898ef4b31f015c40dabbcb3c6a1f925817d4d0 Mon Sep 17 00:00:00 2001 From: Primakov Alexandr Alexandrovich Date: Tue, 22 Oct 2024 16:39:32 +0300 Subject: [PATCH] try open exam as spa --- src/pages/course-list/course-details.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pages/course-list/course-details.tsx b/src/pages/course-list/course-details.tsx index 59f4189..675f679 100644 --- a/src/pages/course-list/course-details.tsx +++ b/src/pages/course-list/course-details.tsx @@ -1,7 +1,7 @@ import React from 'react' import dayjs from 'dayjs' import { Link as ConnectedLink } from 'react-router-dom' -import { getNavigationsValue } from '@brojs/cli' +import { getNavigationsValue, getHistory } from '@brojs/cli' import { Stack, Heading, @@ -21,6 +21,8 @@ type CourseDetailsProps = { populatedCourse: PopulatedCourse; } +const history = getHistory() + export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => { const user = useAppSelector((s) => s.user) const exam = populatedCourse.examWithJury @@ -35,6 +37,10 @@ export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => { as={'a'} colorScheme="blue" href={getNavigationsValue('exam.main') + getNavigationsValue('link.exam.details').replace(':courseId', populatedCourse.id).replace(':examId', exam.id)} + onClick={event => { + event.preventDefault(); + history.push(getNavigationsValue('exam.main') + getNavigationsValue('link.exam.details').replace(':courseId', populatedCourse.id).replace(':examId', exam.id)) + }} > Открыть