Skip to content

Commit

Permalink
Accessibility: improve social links (was 2 tabIndexes), #358
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Jan 24, 2024
1 parent e1802cb commit 1c3f8ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
21 changes: 11 additions & 10 deletions src/common/layout/optima/components/BringTheLove.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';

import type { SxProps } from '@mui/joy/styles/types';
import { Box, Button, Tooltip } from '@mui/joy';
import { Button, Tooltip } from '@mui/joy';

import { Link } from '~/common/components/Link';
import { cssRainbowColorKeyframes } from '~/common/app.theme';
Expand All @@ -26,20 +26,21 @@ export function BringTheLove(props: { text: string, link: string, asIcon?: boole
return (
<Tooltip followCursor title={props.text}>
{props.asIcon ? (
<Box component='a' href={props.link} target='_blank' sx={{
textDecoration: 'none',
'&:hover': { textDecoration: 'none' },
}}>
<DesktopNavIcon variant='solid' className={navItemClasses.typeLinkOrModal} onClick={() => setLoved(true)} sx={{
<DesktopNavIcon
variant='solid'
className={navItemClasses.typeLinkOrModal}
component={Link} href={props.link} target='_blank'
onClick={() => setLoved(true)}
sx={{
background: 'transparent',
// color: 'text.tertiary',
'&:hover': {
animation: `${cssRainbowColorKeyframes} 5s linear infinite`,
},
}}>
{icon}
</DesktopNavIcon>
</Box>
}}
>
{icon}
</DesktopNavIcon>
) : (
<Button
onClick={() => setLoved(true)}
Expand Down
2 changes: 1 addition & 1 deletion src/common/layout/optima/components/DesktopNavIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ export const DesktopNavIcon = styled(IconButton)(({ theme }) => ({
transform: 'scale(1.4)',
},

}));
})) as typeof IconButton;

0 comments on commit 1c3f8ba

Please sign in to comment.