Use aria-pressed on sticker header buttons

This commit is contained in:
Josh Perez 2023-05-04 19:33:36 -04:00
parent 1090a9c3e6
commit e0bae9a47c
2 changed files with 3 additions and 0 deletions
ts
components/stickers
hooks

View file

@ -176,6 +176,7 @@ export const StickerPicker = React.memo(
> >
{hasPacks ? ( {hasPacks ? (
<button <button
aria-pressed={currentTab === 'recents'}
type="button" type="button"
onClick={recentsHandler} onClick={recentsHandler}
className={classNames({ className={classNames({
@ -189,6 +190,7 @@ export const StickerPicker = React.memo(
) : null} ) : null}
{packs.map((pack, i) => ( {packs.map((pack, i) => (
<button <button
aria-pressed={currentTab === pack.id}
type="button" type="button"
key={pack.id} key={pack.id}
onClick={packsHandlers[i]} onClick={packsHandlers[i]}

View file

@ -66,6 +66,7 @@ export function useTabs(options: TabsOptionsType): TabsProps {
<div className={getClassName('')} data-supertab> <div className={getClassName('')} data-supertab>
{options.tabs.map(({ id, label }) => ( {options.tabs.map(({ id, label }) => (
<div <div
aria-selected={selectedTab === id}
className={classNames( className={classNames(
getClassName('__tab'), getClassName('__tab'),
selectedTab === id && getClassName('__tab--selected') selectedTab === id && getClassName('__tab--selected')