Skip to content

Commit b1788d5

Browse files
committed
useKeyDownHandler: update to named export
1 parent 2d8fe06 commit b1788d5

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

client/common/useKeyDownHandlers.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { render } from '@testing-library/react';
3-
import useKeyDownHandlers from './useKeyDownHandlers';
3+
import { useKeyDownHandlers } from './useKeyDownHandlers';
44
import { isMac } from '../utils/device';
55

66
jest.mock('../utils/device');

client/common/useKeyDownHandlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type KeydownHandlerMap = Record<string, KeydownHandler>;
1313
* @param keyHandlers - an object which maps from the key to its event handler. The object keys are a combination of the key and prefixes `ctrl-` `shift-`
1414
* (ie. 'ctrl-f', 'ctrl-shift-f') and the values are the function to call when that specific key is pressed.
1515
*/
16-
export default function useKeyDownHandlers(keyHandlers: KeydownHandlerMap) {
16+
export function useKeyDownHandlers(keyHandlers: KeydownHandlerMap) {
1717
/**
1818
* Instead of memoizing the handlers, use a ref and call the current
1919
* handler at the time of the event.

client/common/useModalClose.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useRef, useEffect } from 'react';
22
import { render, fireEvent } from '@testing-library/react';
33
import { useModalClose } from './useModalClose';
4-
import useKeyDownHandlers from './useKeyDownHandlers';
4+
import { useKeyDownHandlers } from './useKeyDownHandlers';
55

66
jest.mock('./useKeyDownHandlers');
77

client/common/useModalClose.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useRef, MutableRefObject } from 'react';
2-
import useKeyDownHandlers from './useKeyDownHandlers';
2+
import { useKeyDownHandlers } from './useKeyDownHandlers';
33

44
/**
55
* Common logic for Modal, Overlay, etc.

client/modules/IDE/components/IDEKeyHandlers.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from '../actions/ide';
1414
import { setAllAccessibleOutput } from '../actions/preferences';
1515
import { cloneProject, saveProject } from '../actions/project';
16-
import useKeyDownHandlers from '../../../common/useKeyDownHandlers';
16+
import { useKeyDownHandlers } from '../../../common/useKeyDownHandlers';
1717
import {
1818
getAuthenticated,
1919
getIsUserOwner,

0 commit comments

Comments
 (0)