Skip to content

Commit

Permalink
fix: accessibility-related warnings (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
diogotcorreia authored Mar 20, 2024
1 parent a814225 commit 6d8eb76
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const Navbar = ({ toggleSidebar }) => {
return (
<header className='navbar'>
{toggleSidebar && (
<button className='sidebar-button' onClick={toggleSidebar}>
<button className='sidebar-button' onClick={toggleSidebar} aria-label='toggle sidebar'>
<svg
xmlns='http://www.w3.org/2000/svg'
aria-hidden='true'
Expand Down
1 change: 1 addition & 0 deletions src/components/SidePanel/SidePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const Dialog = ({ open, onClose, className, children }) => {
className='sidepanel-backdrop'
ref={containerRef}
role='button'
aria-label='close sidepanel'
tabIndex={0}
onMouseDown={(event) => {
if (event.target === event.currentTarget) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const DropdownSelect = ({ id = 'unknown', value, onChange, children }) => {
return (
<div
className='dropdown-select'
role='none'
onBlur={(e) => !e.relatedTarget?.classList?.contains(`keep-focus-${id}`) && close()}
>
<button onClick={toggleOpen} className={`keep-focus-${id}`}>
Expand All @@ -48,7 +49,7 @@ const DropdownSelect = ({ id = 'unknown', value, onChange, children }) => {
<div className={`options-container${open ? ' options-container--open' : ''}`}>
<div
className='options-container-backdrop'
role='button'
role='none'
onMouseDown={(event) => {
if (event.target === event.currentTarget) {
toggleOpen();
Expand Down
9 changes: 7 additions & 2 deletions src/components/ThemeSettings/ThemeSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ const ThemeSettings = () => {

return (
<>
<button className='icon-btn' onClick={togglePanel} style={{ alignSelf: 'center' }}>
<button
className='icon-btn'
onClick={togglePanel}
style={{ alignSelf: 'center' }}
aria-label='theme settings'
>
<Theme />
</button>
<SidePanel open={panelOpen} onClose={closePanel} className='theme-settings'>
<div className='theme-settings-header'>
<p>Reading Options</p>
<button className='icon-btn' onClick={closePanel}>
<button className='icon-btn' onClick={closePanel} aria-label='close'>
<Close />
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/theme-hooks.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import React, { useEffect, useMemo, useState } from 'react';
import '../styles/themes/black.css';
import '../styles/themes/gruvbox.css';
import '../styles/themes/nord.css';
Expand Down

0 comments on commit 6d8eb76

Please sign in to comment.