Skip to content

Commit e3d1536

Browse files
committed
fix: hide coc link tooltips on mobile
1 parent 2443686 commit e3d1536

1 file changed

Lines changed: 28 additions & 26 deletions

File tree

src/CodeOfConduct.tsx

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,40 +11,42 @@ function CodeOfConduct() {
1111
const { copyAnchorLink, scrollToElement } = useAnchorLinks()
1212

1313
// Component for section header with anchor link
14-
const SectionHeader = ({ id, variant, children, color = 'primary.main' }: {
15-
id: string,
16-
variant: 'h1' | 'h2',
14+
const SectionHeader = ({ id, variant, children, color = 'primary.main' }: {
15+
id: string,
16+
variant: 'h1' | 'h2',
1717
children: React.ReactNode,
18-
color?: string
18+
color?: string
1919
}) => (
20-
<Box
21-
id={id}
22-
sx={{
23-
display: 'flex',
24-
alignItems: 'center',
25-
gap: 1,
20+
<Box
21+
id={id}
22+
sx={{
23+
display: 'flex',
24+
alignItems: 'center',
25+
gap: 1,
2626
mb: 2,
2727
'&:hover .anchor-link': {
2828
opacity: 0.6
2929
}
3030
}}
3131
>
32-
<Tooltip title={t("codeOfConduct.copyLink") || "Copiar enlace"}>
33-
<IconButton
34-
className="anchor-link"
35-
size="small"
36-
onClick={() => copyAnchorLink(id)}
37-
sx={{
38-
opacity: 0,
39-
transition: 'opacity 0.2s ease-in-out',
40-
'&:hover': { opacity: 1 },
41-
color: color,
42-
mr: 0.5
43-
}}
44-
>
45-
<LinkIcon fontSize="small" />
46-
</IconButton>
47-
</Tooltip>
32+
<Box sx={{ display: { xs: 'none', sm: 'flex' }, alignItems: 'center' }}>
33+
<Tooltip title={t("codeOfConduct.copyLink") || "Copiar enlace"}>
34+
<IconButton
35+
className="anchor-link"
36+
size="small"
37+
onClick={() => copyAnchorLink(id)}
38+
sx={{
39+
opacity: 0,
40+
transition: 'opacity 0.2s ease-in-out',
41+
'&:hover': { opacity: 1 },
42+
color: color,
43+
mr: 0.5
44+
}}
45+
>
46+
<LinkIcon fontSize="small" />
47+
</IconButton>
48+
</Tooltip>
49+
</Box>
4850
<Typography variant={variant} sx={{ color, flex: 1 }}>
4951
{children}
5052
</Typography>

0 commit comments

Comments
 (0)