Skip to content

Commit 44f4151

Browse files
authored
Fix close buttons tooltips (#3525)
1 parent f220229 commit 44f4151

File tree

3 files changed

+21
-30
lines changed

3 files changed

+21
-30
lines changed

.changeset/chilly-hats-promise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"gitbook": patch
3+
---
4+
5+
Fix close buttons tooltips

packages/gitbook/src/components/Announcement/AnnouncementBanner.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { tcls } from '@/lib/tailwind';
77
import { type CustomizationAnnouncement, SiteInsightsLinkPosition } from '@gitbook/api';
88
import { Icon, type IconName } from '@gitbook/icons';
99
import { CONTAINER_STYLE } from '../layout';
10-
import { Link } from '../primitives';
10+
import { Button, Link } from '../primitives';
1111
import { LinkStyles } from '../primitives/styles';
1212
import { ANNOUNCEMENT_CSS_CLASS, ANNOUNCEMENT_STORAGE_KEY } from './constants';
1313

@@ -86,14 +86,15 @@ export function AnnouncementBanner(props: {
8686
</div>
8787
</Tag>
8888
{closeable ? (
89-
<button
90-
className={`absolute top-0 right-4 mt-2 mr-2 circular-corners:rounded-lg rounded-sm straight-corners:rounded-none p-1.5 transition-all hover:ring-1 sm:right-6 md:right-8 ${style.close}`}
91-
type="button"
89+
<Button
90+
iconOnly
91+
icon="close"
92+
label={tString(language, 'close')}
93+
variant="blank"
94+
size="default"
9295
onClick={dismissAnnouncement}
93-
title={tString(language, 'close')}
94-
>
95-
<Icon icon="close" className="size-4" />
96-
</button>
96+
className={`absolute top-0 right-4 mt-2 mr-2 circular-corners:rounded-lg rounded-sm straight-corners:rounded-none p-1.5 transition-all hover:ring-1 sm:right-6 md:right-8 ${style.close}`}
97+
/>
9798
) : null}
9899
</div>
99100
</div>

packages/gitbook/src/components/Cookies/CookiesToast.tsx

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
'use client';
2-
3-
import { Icon } from '@gitbook/icons';
42
import * as React from 'react';
53

64
import { Button, StyledLink } from '@/components/primitives';
@@ -75,27 +73,14 @@ export function CookiesToast(props: { privacyPolicy?: string }) {
7573
</StyledLink>
7674
)}
7775
</p>
78-
<button
79-
type="button"
76+
<Button
77+
iconOnly
78+
icon="close"
79+
label={tString(language, 'close')}
80+
variant="blank"
8081
onClick={() => setShow(false)}
81-
aria-label={tString(language, 'close')}
82-
className={tcls(
83-
'absolute',
84-
'top-3',
85-
'right-3',
86-
'w-6',
87-
'h-6',
88-
'flex',
89-
'justify-center',
90-
'items-center',
91-
'rounded-xs',
92-
'circular-corners:rounded-full',
93-
'hover:bg-tint-hover'
94-
)}
95-
title={tString(language, 'close')}
96-
>
97-
<Icon icon="xmark" className={tcls('size-4')} />
98-
</button>
82+
className={tcls('absolute', 'top-2', 'right-2', 'hover:bg-tint-hover')}
83+
/>
9984
<div className={tcls('mt-3', 'flex', 'flex-row', 'gap-2')}>
10085
<Button
10186
variant="primary"

0 commit comments

Comments
 (0)