Skip to content

Commit

Permalink
Remove keycode, reduce bundle size
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Apr 5, 2020
1 parent 66da7ce commit 2fa0224
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
]
},
"dependencies": {
"keycode": "^2.2.0",
"polished": "^3.4.1",
"prismjs": "1.17.1",
"react-modal": "^3.10.1",
Expand Down
3 changes: 1 addition & 2 deletions src/components/tooltip/WithTooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import styled from 'styled-components';
import TooltipTrigger from 'react-popper-tooltip';
import uuid from 'uuid';
import keyCode from 'keycode';

import { Tooltip } from './Tooltip';

Expand Down Expand Up @@ -54,7 +53,7 @@ const AsComponent = React.forwardRef(
if (!onClick) {
return;
}
if (event.keyCode === keyCode('enter') || event.keyCode === keyCode('space')) {
if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault();
onClick(event);
}
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9068,11 +9068,6 @@ jsx-ast-utils@^2.2.1:
array-includes "^3.0.3"
object.assign "^4.1.0"

keycode@^2.2.0:
version "2.2.0"
resolved "https://registry.npmjs.org/keycode/-/keycode-2.2.0.tgz#3d0af56dc7b8b8e5cba8d0a97f107204eec22b04"
integrity sha1-PQr1bce4uOXLqNCpfxByBO7CKwQ=

kind-of@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/kind-of/-/kind-of-2.0.1.tgz#018ec7a4ce7e3a86cb9141be519d24c8faa981b5"
Expand Down

0 comments on commit 2fa0224

Please sign in to comment.