Skip to content

Commit

Permalink
Add labels to icon buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
NotWoods committed May 10, 2024
1 parent c2a84e7 commit ca47b78
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/client/components/Button/CloseButton.tsx
Expand Up @@ -11,6 +11,7 @@ export function CloseButton(props: Props) {
return (
<IconButton
class={props.class}
title="Close"
onClick={props.onClick}
style={{ gridArea: 'close' }}
>
Expand Down
1 change: 1 addition & 0 deletions packages/client/components/Button/FloatingActionButton.tsx
Expand Up @@ -9,6 +9,7 @@ export function FloatingActionButton({ mini, ...props }: Props) {
return (
<button
type="button"
aria-label={props.title}
{...props}
class={clsx(
'group text-white focus:ring-cyan',
Expand Down
2 changes: 2 additions & 0 deletions packages/client/components/Button/IconButton.tsx
Expand Up @@ -3,6 +3,7 @@ import type { JSX } from 'preact';
import { forwardRef } from 'preact/compat';

interface Props extends JSX.HTMLAttributes<HTMLButtonElement> {
title?: string;
forceDark?: boolean;
}

Expand All @@ -17,6 +18,7 @@ export const IconButton = forwardRef<HTMLButtonElement, Props>(
return (
<button
type="button"
aria-label={props.title}
{...props}
class={clsx(
'block flex-shrink-0 rounded-full w-12 h-12 p-3 focus:ring-cyan focus:border-cyan border-transparent bg-opacity-0 dark:bg-opacity-0 hover:bg-opacity-10 motion-safe:transition-colors',
Expand Down
1 change: 1 addition & 0 deletions packages/client/page/overlay/BaseOverlay.tsx
Expand Up @@ -55,6 +55,7 @@ export function BaseOverlay({ children, title, logo, onNavigate }: Props) {
onClick={onNavigate}
forceDark
accessKey="s"
title="Up"
>
<UpIcon />
</IconButton>
Expand Down

0 comments on commit ca47b78

Please sign in to comment.