try open exam as spa
This commit is contained in:
parent
26c8a477c3
commit
b2898ef4b3
@ -1,7 +1,7 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
import { Link as ConnectedLink } from 'react-router-dom'
|
import { Link as ConnectedLink } from 'react-router-dom'
|
||||||
import { getNavigationsValue } from '@brojs/cli'
|
import { getNavigationsValue, getHistory } from '@brojs/cli'
|
||||||
import {
|
import {
|
||||||
Stack,
|
Stack,
|
||||||
Heading,
|
Heading,
|
||||||
@ -21,6 +21,8 @@ type CourseDetailsProps = {
|
|||||||
populatedCourse: PopulatedCourse;
|
populatedCourse: PopulatedCourse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const history = getHistory()
|
||||||
|
|
||||||
export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => {
|
export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => {
|
||||||
const user = useAppSelector((s) => s.user)
|
const user = useAppSelector((s) => s.user)
|
||||||
const exam = populatedCourse.examWithJury
|
const exam = populatedCourse.examWithJury
|
||||||
@ -35,6 +37,10 @@ export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => {
|
|||||||
as={'a'}
|
as={'a'}
|
||||||
colorScheme="blue"
|
colorScheme="blue"
|
||||||
href={getNavigationsValue('exam.main') + getNavigationsValue('link.exam.details').replace(':courseId', populatedCourse.id).replace(':examId', exam.id)}
|
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>
|
</Button>
|
||||||
|
Loading…
Reference in New Issue
Block a user