Skip to content

Commit fc38ed7

Browse files
committed
fix
1 parent 69c8c3c commit fc38ed7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

pages/tools/components/ToolingDetailModal.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,18 @@ export default function ToolingDetailModal({
2323
};
2424
}, []);
2525

26+
useEffect(() => {
27+
const clickEsc = (event: KeyboardEvent) => {
28+
if (event.key === 'Escape') {
29+
onClose();
30+
}
31+
};
32+
document.addEventListener('keydown', clickEsc);
33+
return () => {
34+
document.removeEventListener('keydown', clickEsc);
35+
};
36+
}, [onClose]);
37+
2638
return (
2739
<div className='fixed inset-0 flex items-center justify-center z-50 overflow-x-hidden'>
2840
<div
@@ -36,9 +48,9 @@ export default function ToolingDetailModal({
3648
<div className='flex justify-end absolute top-0 right-0 mt-6 mr-6'>
3749
<button
3850
onClick={onClose}
39-
className='text-gray-500 hover:text-gray-700'
51+
className='text-gray-500 hover:text-gray-300'
4052
>
41-
<CancelIcon className='fill-current stroke-current w-3 h-3' />
53+
<CancelIcon className='fill-current stroke-current w-4 h-4' />
4254
</button>
4355
</div>
4456
<div className='mt-4 flex flex-row items-center justify-start gap-2'>

0 commit comments

Comments
 (0)