@@ -6,6 +6,7 @@ import { Ripples } from '@atoms'
66import { vars } from '@theme'
77import { isCourseActive } from '../utils'
88import * as Type from '../types'
9+ import { useEnterNavigate } from '../utils/useEnterNavigate'
910
1011export const CourseBoxContext = React . createContext < Partial < Type . ExtendAcademicList > > ( { } )
1112
@@ -25,6 +26,8 @@ export function BoxTraditional({ data, modalPaymentText }: IBoxTraditional): JSX
2526 const isClickable = isCourseActive ( data . action ?. enabled ?? false , data . Profile ?. id )
2627 const hasHref = ! ! data . action ?. href
2728
29+ useEnterNavigate ( )
30+
2831 const cssActive = {
2932 boxShadow : `0 2px 7px 0 ${ vars ( 'colors-neutral-silverSand' ) } ` ,
3033 }
@@ -33,6 +36,7 @@ export function BoxTraditional({ data, modalPaymentText }: IBoxTraditional): JSX
3336 < CourseBoxContext . Provider value = { data } >
3437 < LinkBox
3538 as = "article"
39+ className = "focusable-link"
3640 border = { vars ( 'borders-light' ) }
3741 borderRadius = { vars ( 'radii-big' ) }
3842 cursor = { isClickable ? 'pointer' : 'default' }
@@ -43,14 +47,21 @@ export function BoxTraditional({ data, modalPaymentText }: IBoxTraditional): JSX
4347 _focusWithin = { {
4448 boxShadow : `0 0 0 3px ${ vars ( 'colors-alert-deepSkyBlue' ) } inset` ,
4549 } }
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 }
4853 >
49- < WithRipples enabled = { isCourseActive ( data . action ?. enabled ?? false , data . Profile ?. id ) } >
54+ < WithRipples enabled = { isClickable } >
5055 < Flex direction = "column" justify = "space-between" h = "100%" >
5156 < Box className = "CourseList-TraditionalBox" >
5257 { 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+ />
5465 ) }
5566 < Header />
5667 < Section />
0 commit comments