File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff 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' >
You can’t perform that action at this time.
0 commit comments