Skip to content

Commit 489131b

Browse files
fix(PDYE-1342): focus visible de listado cursos y botones barra transversal (#739)
Co-authored-by: Javiera Munita <javiera.munita@eclass.cl>
1 parent b7c4d20 commit 489131b

File tree

3 files changed

+26
-22
lines changed

3 files changed

+26
-22
lines changed

src/molecules/NavBarButtons/NavBarButton.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ export const NavBarButton = ({
6363
className="nav-bar-button"
6464
id={isAccessibility ? 'UserWayButton' : ''}
6565
onClick={isAccessibility ? triggerWidget : onClick}
66+
_focusVisible={{
67+
outline: `3px solid ${vars('colors-alert-deepSkyBlue')}`,
68+
borderRadius: '2px',
69+
}}
70+
tabIndex={0}
6671
sx={{
6772
alignItems: 'center',
6873
background: 'none !important',
@@ -115,8 +120,14 @@ export const NavBarButton = ({
115120
},
116121
}}
117122
>
118-
<Box className="nav-bar-icon">{buttonType[type].icon}</Box>
119-
{!isMobile && <Box className="nav-bar-text">{buttonType[type].text}</Box>}
123+
<Box className="nav-bar-icon" tabIndex={-1}>
124+
{buttonType[type].icon}
125+
</Box>
126+
{!isMobile && (
127+
<Box className="nav-bar-text" tabIndex={-1}>
128+
{buttonType[type].text}
129+
</Box>
130+
)}
120131
</Box>
121132
)
122133
}

src/organisms/CourseList/Boxes/BoxTraditional.tsx

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,42 @@ interface WithRipplesProps {
1616
function WithRipples({ enabled, children }: WithRipplesProps): JSX.Element {
1717
return enabled ? <Ripples>{children}</Ripples> : <>{children}</>
1818
}
19-
2019
interface IBoxTraditional {
2120
data: Type.ExtendAcademicList
2221
modalPaymentText?: Type.PaymentText
2322
}
2423

2524
export 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>

src/organisms/CourseList/components/Footer.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,11 @@ export function Footer({ modalPaymentText }: Type.FooterProps): JSX.Element | nu
3333
p="1rem"
3434
borderTop="1px solid"
3535
borderTopColor={vars('colors-neutral-platinum')}
36-
tabIndex={0}
37-
className="footerButtonBox"
3836
>
3937
{isCourseActive(action.enabled, Profile?.id) ? (
4038
<>
4139
{hasFinanzeFreezed && modalPaymentText ? (
4240
<Box
43-
className="uno"
4441
color={vars('colors-main-deepSkyBlue')}
4542
backgroundColor="transparent"
4643
fontWeight="500"
@@ -59,7 +56,6 @@ export function Footer({ modalPaymentText }: Type.FooterProps): JSX.Element | nu
5956
</Box>
6057
) : (
6158
<Text
62-
className="dos"
6359
color={vars('colors-main-deepSkyBlue')}
6460
fontWeight="500"
6561
mr={action.hasIcon ? '1.5rem' : '0'}
@@ -74,7 +70,6 @@ export function Footer({ modalPaymentText }: Type.FooterProps): JSX.Element | nu
7470
</>
7571
) : (
7672
<Text
77-
className="tres"
7873
fontWeight="500"
7974
lineHeight="1.172rem"
8075
color={vars('colors-neutral-spanishGrey')}

0 commit comments

Comments
 (0)