Commit bf49560d authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Add more specific labels for some close buttons

parent 39ccd7eb
...@@ -114,7 +114,7 @@ function HelpPanel({ session }: HelpPanelProps) { ...@@ -114,7 +114,7 @@ function HelpPanel({ session }: HelpPanelProps) {
onActiveChanged={onActiveChanged} onActiveChanged={onActiveChanged}
variant="custom" variant="custom"
> >
<TabHeader> <TabHeader closeTitle="Close help panel">
<Tab <Tab
id={tutorialTabId} id={tutorialTabId}
aria-controls={tutorialPanelId} aria-controls={tutorialPanelId}
......
...@@ -39,7 +39,7 @@ export default function ShareDialog({ shareTab }: ShareDialogProps) { ...@@ -39,7 +39,7 @@ export default function ShareDialog({ shareTab }: ShareDialogProps) {
panelName="shareGroupAnnotations" panelName="shareGroupAnnotations"
variant="custom" variant="custom"
> >
<TabHeader> <TabHeader closeTitle="Close share panel">
{shareTab && ( {shareTab && (
<Tab <Tab
id="share-panel-tab" id="share-panel-tab"
......
...@@ -2,14 +2,16 @@ import { CloseButton, TabList } from '@hypothesis/frontend-shared'; ...@@ -2,14 +2,16 @@ import { CloseButton, TabList } from '@hypothesis/frontend-shared';
import classnames from 'classnames'; import classnames from 'classnames';
import type { ComponentChildren } from 'preact'; import type { ComponentChildren } from 'preact';
export type TabHeaderProps = {
children: ComponentChildren;
/** Title for the close button. */
closeTitle: string;
};
/** /**
* Render a header to go above a Card, with contents in a TabList * Render a header to go above a Card, with contents in a TabList
*/ */
export default function TabHeader({ export default function TabHeader({ children, closeTitle }: TabHeaderProps) {
children,
}: {
children: ComponentChildren;
}) {
return ( return (
<div data-testid="tab-header" className="flex items-center"> <div data-testid="tab-header" className="flex items-center">
<CloseButton <CloseButton
...@@ -30,7 +32,7 @@ export default function TabHeader({ ...@@ -30,7 +32,7 @@ export default function TabHeader({
// the `Tab` components rendered inside the `TabList`. See issue #6131. // the `Tab` components rendered inside the `TabList`. See issue #6131.
'touch:!min-h-0', 'touch:!min-h-0',
)} )}
title="Close" title={closeTitle}
variant="custom" variant="custom"
size="sm" size="sm"
/> />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment