-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): Upgrade React dependencies to v17 (#1334)
- Loading branch information
Showing
12 changed files
with
356 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
src/lib/viewers/controls/hooks/__tests__/usePreventKey-test.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
export { default as useAttention } from './useAttention'; | ||
export { default as useFullscreen } from './useFullscreen'; | ||
export { default as usePreventKey } from './usePreventKey'; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
import React from 'react'; | ||
import usePreventKey from '../hooks/usePreventKey'; | ||
import { decodeKeydown } from '../../../util'; | ||
|
||
export type Props = React.ButtonHTMLAttributes<HTMLButtonElement>; | ||
|
||
export default function MediaToggle(props: Props): JSX.Element { | ||
const buttonElRef = React.useRef<HTMLButtonElement>(null); | ||
const handleKeydown = (event: React.KeyboardEvent): void => { | ||
const key = decodeKeydown(event); | ||
|
||
usePreventKey(buttonElRef, ['Enter', 'Space']); | ||
if (key === 'Enter' || key === 'Space') { | ||
event.stopPropagation(); | ||
} | ||
}; | ||
|
||
return <button ref={buttonElRef} type="button" {...props} />; | ||
return <button onKeyDown={handleKeydown} type="button" {...props} />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.