File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
2525} from '../../constants' ;
2626import { buildBlockContainerUrl } from '../utils' ;
2727import { useCourseAuthoringContext } from '@src/CourseAuthoringContext' ;
28+ import { Link } from 'react-router-dom' ;
2829
2930const BrokenLinkHref : FC < { href : string ; } > = ( { href } ) => {
3031 const handleClick = ( event : React . MouseEvent < HTMLAnchorElement > ) => {
@@ -42,16 +43,12 @@ const BrokenLinkHref: FC<{ href: string; }> = ({ href }) => {
4243} ;
4344
4445const GoToBlock : FC < { block : { url : string ; displayName ?: string ; } ; } > = ( { block } ) => {
45- const handleClick = ( event : React . MouseEvent < HTMLAnchorElement > ) => {
46- event . preventDefault ( ) ;
47- window . open ( block . url , '_blank' ) ;
48- } ;
4946
5047 return (
5148 < div className = "go-to-block-link-container" >
52- < a href = { block . url } onClick = { handleClick } className = "broken-link" rel = "noreferrer" >
49+ < Link to = { block . url } className = "broken-link" rel = "noreferrer" target = "_blank ">
5350 { block . displayName }
54- </ a >
51+ </ Link >
5552 </ div >
5653 ) ;
5754} ;
Original file line number Diff line number Diff line change 1- import { createCorrectInternalRoute } from '../utils' ;
21import { LinkCheckResult } from './types' ;
32
43export const buildBlockContainerUrl = (
54 courseId : string ,
65 unitId : string ,
76 blockId : string ,
87) : string => {
9- const path = `/course/${ courseId } /container/${ unitId } #${ blockId } ` ;
10- const internalPath = createCorrectInternalRoute ( path ) ;
11- return internalPath ;
8+ return `/course/${ courseId } /container/${ unitId } #${ blockId } ` ;
129} ;
1310
1411export const countBrokenLinks = (
You can’t perform that action at this time.
0 commit comments