Skip to content

Commit 1c3f8ba

Browse files
committed
Accessibility: improve social links (was 2 tabIndexes), #358
1 parent e1802cb commit 1c3f8ba

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

src/common/layout/optima/components/BringTheLove.tsx

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as React from 'react';
22

33
import type { SxProps } from '@mui/joy/styles/types';
4-
import { Box, Button, Tooltip } from '@mui/joy';
4+
import { Button, Tooltip } from '@mui/joy';
55

66
import { Link } from '~/common/components/Link';
77
import { cssRainbowColorKeyframes } from '~/common/app.theme';
@@ -26,20 +26,21 @@ export function BringTheLove(props: { text: string, link: string, asIcon?: boole
2626
return (
2727
<Tooltip followCursor title={props.text}>
2828
{props.asIcon ? (
29-
<Box component='a' href={props.link} target='_blank' sx={{
30-
textDecoration: 'none',
31-
'&:hover': { textDecoration: 'none' },
32-
}}>
33-
<DesktopNavIcon variant='solid' className={navItemClasses.typeLinkOrModal} onClick={() => setLoved(true)} sx={{
29+
<DesktopNavIcon
30+
variant='solid'
31+
className={navItemClasses.typeLinkOrModal}
32+
component={Link} href={props.link} target='_blank'
33+
onClick={() => setLoved(true)}
34+
sx={{
3435
background: 'transparent',
3536
// color: 'text.tertiary',
3637
'&:hover': {
3738
animation: `${cssRainbowColorKeyframes} 5s linear infinite`,
3839
},
39-
}}>
40-
{icon}
41-
</DesktopNavIcon>
42-
</Box>
40+
}}
41+
>
42+
{icon}
43+
</DesktopNavIcon>
4344
) : (
4445
<Button
4546
onClick={() => setLoved(true)}

src/common/layout/optima/components/DesktopNavIcon.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ export const DesktopNavIcon = styled(IconButton)(({ theme }) => ({
8383
transform: 'scale(1.4)',
8484
},
8585

86-
}));
86+
})) as typeof IconButton;

0 commit comments

Comments
 (0)