@@ -6,6 +6,7 @@ import { Ripples } from '@atoms'
6
6
import { vars } from '@theme'
7
7
import { isCourseActive } from '../utils'
8
8
import * as Type from '../types'
9
+ import { useEnterNavigate } from '../utils/useEnterNavigate'
9
10
10
11
export const CourseBoxContext = React . createContext < Partial < Type . ExtendAcademicList > > ( { } )
11
12
@@ -25,6 +26,8 @@ export function BoxTraditional({ data, modalPaymentText }: IBoxTraditional): JSX
25
26
const isClickable = isCourseActive ( data . action ?. enabled ?? false , data . Profile ?. id )
26
27
const hasHref = ! ! data . action ?. href
27
28
29
+ useEnterNavigate ( )
30
+
28
31
const cssActive = {
29
32
boxShadow : `0 2px 7px 0 ${ vars ( 'colors-neutral-silverSand' ) } ` ,
30
33
}
@@ -33,6 +36,7 @@ export function BoxTraditional({ data, modalPaymentText }: IBoxTraditional): JSX
33
36
< CourseBoxContext . Provider value = { data } >
34
37
< LinkBox
35
38
as = "article"
39
+ className = "focusable-link"
36
40
border = { vars ( 'borders-light' ) }
37
41
borderRadius = { vars ( 'radii-big' ) }
38
42
cursor = { isClickable ? 'pointer' : 'default' }
@@ -43,14 +47,21 @@ export function BoxTraditional({ data, modalPaymentText }: IBoxTraditional): JSX
43
47
_focusWithin = { {
44
48
boxShadow : `0 0 0 3px ${ vars ( 'colors-alert-deepSkyBlue' ) } inset` ,
45
49
} }
46
- tabIndex = { ! hasHref && isClickable ? 0 : undefined }
47
- role = "link"
50
+ tabIndex = { 0 }
51
+ role = { hasHref ? 'link' : undefined }
52
+ data-href = { hasHref ? data . action ?. href : undefined }
48
53
>
49
- < WithRipples enabled = { isCourseActive ( data . action ?. enabled ?? false , data . Profile ?. id ) } >
54
+ < WithRipples enabled = { isClickable } >
50
55
< Flex direction = "column" justify = "space-between" h = "100%" >
51
56
< Box className = "CourseList-TraditionalBox" >
52
57
{ isClickable && hasHref && (
53
- < LinkOverlay href = { data . action ?. href } isExternal = { data . action ?. targetBlank } />
58
+ < LinkOverlay
59
+ className = "course-link-overlay"
60
+ bg = "gray"
61
+ href = { data . action ?. href }
62
+ isExternal = { data . action ?. targetBlank }
63
+ tabIndex = { - 1 }
64
+ />
54
65
) }
55
66
< Header />
56
67
< Section />
0 commit comments