try open exam as spa

This commit is contained in:
Primakov Alexandr Alexandrovich 2024-10-22 16:39:32 +03:00
parent 26c8a477c3
commit b2898ef4b3

View File

@ -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))
}}
>
Открыть
</Button>