Skip to content

Commit 0d4eea1

Browse files
🎨 Palette: Add aria-label and focus states to close icons
This commit enhances the accessibility of the application by adding missing `aria-label` attributes and keyboard focus visible states to icon-only "Close" buttons (`<X />`) in the `Dashboard.tsx` and `Analytics.tsx` components. It ensures screen reader users understand the purpose of the buttons and keyboard navigators can clearly see when the buttons are focused. Co-authored-by: Alesiobarquin <156465247+Alesiobarquin@users.noreply.github.com>
1 parent e62f88e commit 0d4eea1

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/components/Analytics.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,8 +913,9 @@ export const Analytics: React.FC = () => {
913913
</div>
914914
</div>
915915
<button
916+
aria-label="Close session details"
916917
onClick={() => setViewingSession(null)}
917-
className="w-10 h-10 flex items-center justify-center rounded-full hover:bg-zinc-800 text-zinc-400 hover:text-zinc-100 transition-colors"
918+
className="w-10 h-10 flex items-center justify-center rounded-full hover:bg-zinc-800 text-zinc-400 hover:text-zinc-100 transition-colors focus-visible:ring-2 focus-visible:ring-emerald-500 outline-none"
918919
>
919920
<X size={24} />
920921
</button>

src/components/Dashboard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ export const Dashboard: React.FC = () => {
568568
<button onClick={() => setCatchUpPlan('CATCH_UP', missedDaysCount)} className="flex-1 sm:flex-none px-4 py-2 bg-amber-500 hover:bg-amber-400 text-amber-950 font-bold text-sm rounded-lg shadow-[0_0_15px_rgba(245,158,11,0.3)] transition-all flex items-center justify-center gap-2">
569569
<Zap size={16} /> Catch Up Faster
570570
</button>
571-
<button onClick={dismissCatchUpBanner} className="px-2 py-2 text-zinc-500 hover:text-zinc-300 rounded-lg hover:bg-zinc-800/50 transition-colors"><X size={18} /></button>
571+
<button aria-label="Dismiss catch-up banner" onClick={dismissCatchUpBanner} className="px-2 py-2 text-zinc-500 hover:text-zinc-300 rounded-lg hover:bg-zinc-800/50 transition-colors focus-visible:ring-2 focus-visible:ring-emerald-500 outline-none"><X size={18} /></button>
572572
</div>
573573
</div>
574574
</div>

0 commit comments

Comments
 (0)