Skip to content

Commit

Permalink
add aria-live to toggle button
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Bartosik committed May 24, 2021
1 parent 613c219 commit 09fa077
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@ const Header: React.FC<{ toggleTheme: () => void; theme: string }> = ({
<StyledHeading to="/" style={{ textDecoration: 'none' }}>
Where in the world?
</StyledHeading>
<ToggleButton
onClick={toggleTheme}
aria-label={
theme === Theme.Light
? 'Change to dark mode'
: 'Change to light mode'
}
>
<ToggleButton onClick={toggleTheme} aria-live="polite">
{theme === Theme.Light ? <IoMoonOutline /> : <FiSun />}
<span>{theme === Theme.Light ? 'Dark Mode' : 'Light Mode'}</span>
</ToggleButton>
Expand Down

1 comment on commit 09fa077

@vercel
Copy link

@vercel vercel bot commented on 09fa077 May 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.