@@ -16,44 +16,42 @@ interface WithRipplesProps {
1616function WithRipples ( { enabled, children } : WithRipplesProps ) : JSX . Element {
1717 return enabled ? < Ripples > { children } </ Ripples > : < > { children } </ >
1818}
19-
2019interface IBoxTraditional {
2120 data : Type . ExtendAcademicList
2221 modalPaymentText ?: Type . PaymentText
2322}
2423
2524export function BoxTraditional ( { data, modalPaymentText } : IBoxTraditional ) : JSX . Element {
25+ const isClickable = isCourseActive ( data . action ?. enabled ?? false , data . Profile ?. id )
26+ const hasHref = ! ! data . action ?. href
27+
2628 const cssActive = {
2729 boxShadow : `0 2px 7px 0 ${ vars ( 'colors-neutral-silverSand' ) } ` ,
2830 }
2931
3032 return (
3133 < CourseBoxContext . Provider value = { data } >
3234 < LinkBox
33- className = "linkBoxTraditional"
3435 as = "article"
3536 border = { vars ( 'borders-light' ) }
3637 borderRadius = { vars ( 'radii-big' ) }
37- cursor = " pointer"
38+ cursor = { isClickable ? ' pointer' : 'default' }
3839 transition = "box-shadow .3s"
39- _active = { cssActive }
40- _hover = { cssActive }
4140 overflow = "hidden"
42- tabIndex = { 0 }
41+ _hover = { cssActive }
42+ _active = { cssActive }
43+ _focusWithin = { {
44+ boxShadow : `0 0 0 3px ${ vars ( 'colors-alert-deepSkyBlue' ) } inset` ,
45+ } }
46+ tabIndex = { ! hasHref && isClickable ? 0 : undefined }
4347 role = "link"
4448 >
4549 < WithRipples enabled = { isCourseActive ( data . action ?. enabled ?? false , data . Profile ?. id ) } >
4650 < Flex direction = "column" justify = "space-between" h = "100%" >
4751 < Box className = "CourseList-TraditionalBox" >
48- { ! data . hasFinanzeFreezed &&
49- isCourseActive ( data . action ?. enabled ?? false , data . Profile ?. id ) && (
50- < LinkOverlay
51- href = { data . action ?. href }
52- isExternal = { data . action ?. targetBlank }
53- tabIndex = { - 1 }
54- className = "linkOverlay"
55- />
56- ) }
52+ { isClickable && hasHref && (
53+ < LinkOverlay href = { data . action ?. href } isExternal = { data . action ?. targetBlank } />
54+ ) }
5755 < Header />
5856 < Section />
5957 </ Box >
0 commit comments