From da287d459ce85f1b2a28a2be75380348b2eeb122 Mon Sep 17 00:00:00 2001 From: findthelorax Date: Mon, 20 Apr 2026 23:57:28 -0400 Subject: [PATCH] allow for keyboard navigation and adjusted card height to match regardless of text inside --- frontend/src/components/modals/ThemeModal.tsx | 41 +++++++++++++++---- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/modals/ThemeModal.tsx b/frontend/src/components/modals/ThemeModal.tsx index 62901e7..5b50979 100644 --- a/frontend/src/components/modals/ThemeModal.tsx +++ b/frontend/src/components/modals/ThemeModal.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react' +import { useRef, useState, type KeyboardEvent } from 'react' import { toast } from 'sonner' import { Check } from 'lucide-react' import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog' @@ -14,17 +14,21 @@ interface ThemeCardProps { themeId: ThemeId selected: boolean onClick: () => void + onKeyDown?: (event: KeyboardEvent) => void + buttonRef?: (element: HTMLButtonElement | null) => void } -function ThemeCard({ themeId, selected, onClick }: ThemeCardProps) { +function ThemeCard({ themeId, selected, onClick, onKeyDown, buttonRef }: ThemeCardProps) { const preset = THEMES[themeId] const c = preset.colors return (