Skip to content

Commit 9081bf4

Browse files
TheAlexLichterSaraVieira
authored andcommitted
Better keycode management & small cleanup (codesandbox#1432)
* chore: use destructuring again * refactor: use keycodes file to remove magic numbers * Add @manniL as a contributor * fix: linting (partly)
1 parent ff3eec3 commit 9081bf4

File tree

23 files changed

+76
-65
lines changed

23 files changed

+76
-65
lines changed

.all-contributorsrc

+9
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,15 @@
670670
"contributions": [
671671
"doc"
672672
]
673+
},
674+
{
675+
"login": "manniL",
676+
"name": "Alexander Lichter",
677+
"avatar_url": "https://avatars0.githubusercontent.com/u/640208?v=4",
678+
"profile": "https://blog.lichter.io",
679+
"contributions": [
680+
"code"
681+
]
673682
}
674683
],
675684
"repoType": "github"

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [CodeSandbox](https://codesandbox.io) [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/codesandbox) [![All Contributors](https://img.shields.io/badge/all_contributors-69-orange.svg?style=flat-square)](#contributors) [![CircleCI](https://circleci.com/gh/CompuIves/codesandbox-client.svg?style=svg)](https://circleci.com/gh/CompuIves/codesandbox-client) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)](https://www.browserstack.com/automate/public-build/cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
1+
# [CodeSandbox](https://codesandbox.io) [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/codesandbox) [![All Contributors](https://img.shields.io/badge/all_contributors-70-orange.svg?style=flat-square)](#contributors) [![CircleCI](https://circleci.com/gh/CompuIves/codesandbox-client.svg?style=svg)](https://circleci.com/gh/CompuIves/codesandbox-client) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf)](https://www.browserstack.com/automate/public-build/cVJuczlJWUtqWXhIbFN1ZjVQekF4NzNsd3phNEZRaGlWU0pHYVVkdGRFWT0tLXFtTVhaOWRySmN0ZG5QVDNDQ0g5Z0E9PQ==--79fe3eae4f149a400d396c9b12d3988f685785cf) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![first-timers-only Friendly](https://img.shields.io/badge/first--timers--only-friendly-blue.svg)](http://www.firsttimersonly.com/)
22

33
[![Backers on Open Collective](https://opencollective.com/codesandbox/backers/badge.svg)](#backers) [![Sponsors on Open Collective](https://opencollective.com/codesandbox/sponsors/badge.svg)](#sponsors)
44

@@ -51,8 +51,7 @@ Thanks goes to these wonderful people
5151
| [<img src="https://avatars0.githubusercontent.com/u/1820292?v=4" width="100px;"/><br /><sub><b>Michel Weststrate</b></sub>](https://twitter.com/mweststrate)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=mweststrate "Code") | [<img src="https://avatars0.githubusercontent.com/u/52824?v=4" width="100px;"/><br /><sub><b>Oleg</b></sub>](https://kof.github.io)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=kof "Code") | [<img src="https://avatars0.githubusercontent.com/u/1127037?v=4" width="100px;"/><br /><sub><b>Paul Sherman</b></sub>](https://www.pshrmn.com)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Apshrmn "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=pshrmn "Code") | [<img src="https://avatars2.githubusercontent.com/u/9244507?v=4" width="100px;"/><br /><sub><b>Ro Savage</b></sub>](https://github.com/ro-savage)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=ro-savage "Code") | [<img src="https://avatars3.githubusercontent.com/u/13242392?v=4" width="100px;"/><br /><sub><b>Sam Denty</b></sub>](https://samdd.me)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=samdenty99 "Code") | [<img src="https://avatars1.githubusercontent.com/u/3087225?v=4" width="100px;"/><br /><sub><b>Zephraph</b></sub>](https://github.com/zephraph)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=zephraph "Code") | [<img src="https://avatars1.githubusercontent.com/u/1900735?v=4" width="100px;"/><br /><sub><b>Josh Waller</b></sub>](https://www.joshwaller.me)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Amdxprograms "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=mdxprograms "Code") [📖](https://github.com/CompuIves/codesandbox-client/commits?author=mdxprograms "Documentation") |
5252
| [<img src="https://avatars0.githubusercontent.com/u/1195863?v=4" width="100px;"/><br /><sub><b>Joe Ng'ethe</b></sub>](http://joey.co.ke)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=joeynimu "Code") | [<img src="https://avatars0.githubusercontent.com/u/576935?v=4" width="100px;"/><br /><sub><b>Carles Codony</b></sub>](https://github.com/bitblitter)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=bitblitter "Code") | [<img src="https://avatars2.githubusercontent.com/u/468006?v=4" width="100px;"/><br /><sub><b>Vytenis</b></sub>](https://github.com/FDiskas)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=FDiskas "Code") | [<img src="https://avatars1.githubusercontent.com/u/894149?v=4" width="100px;"/><br /><sub><b>Manuel Dugué</b></sub>](http://manueldugue.de)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Amdugue "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=mdugue "Code") | [<img src="https://avatars2.githubusercontent.com/u/5346497?v=4" width="100px;"/><br /><sub><b>Demian Dekoninck</b></sub>](https://dem.be)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=DemianD "Code") | [<img src="https://avatars2.githubusercontent.com/u/3144549?v=4" width="100px;"/><br /><sub><b>Drake Costa</b></sub>](http://www.saeris.io)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=Saeris "Code") | [<img src="https://avatars2.githubusercontent.com/u/433394?v=4" width="100px;"/><br /><sub><b>Marko Stijak</b></sub>](https://cxjs.io/)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=mstijak "Code") |
5353
| [<img src="https://avatars2.githubusercontent.com/u/10588170?v=4" width="100px;"/><br /><sub><b>Ilya</b></sub>](https://twitter.com/ilya_komar0ff)<br />[💬](#question-Komar0ff "Answering Questions") [🤔](#ideas-Komar0ff "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/10627086?v=4" width="100px;"/><br /><sub><b>Emerson Laurentino</b></sub>](https://twitter.com/elaurent_)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=emersonlaurentino "Code") [🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Aemersonlaurentino "Bug reports") | [<img src="https://avatars3.githubusercontent.com/u/180963?v=4" width="100px;"/><br /><sub><b>Aaron Reisman</b></sub>](https://github.com/lifeiscontent)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Alifeiscontent "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=lifeiscontent "Code") [📦](#platform-lifeiscontent "Packaging/porting to new platform") | [<img src="https://avatars2.githubusercontent.com/u/19484365?v=4" width="100px;"/><br /><sub><b>Colton Colcleasure</b></sub>](https://github.com/colshacol)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=colshacol "Code") [🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Acolshacol "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/497242?v=4" width="100px;"/><br /><sub><b>PJ Walker</b></sub>](https://github.com/PJWalker)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3APJWalker "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=PJWalker "Code") | [<img src="https://avatars2.githubusercontent.com/u/29819102?v=4" width="100px;"/><br /><sub><b>Satya Rohith</b></sub>](https://satya.tech)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=satyarohith "Code") [📖](https://github.com/CompuIves/codesandbox-client/commits?author=satyarohith "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/17421347?v=4" width="100px;"/><br /><sub><b>Melanie Seltzer</b></sub>](https://www.melanieseltzer.io/)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=melanieseltzer "Code") |
54-
| [<img src="https://avatars1.githubusercontent.com/u/23313266?v=4" width="100px;"/><br /><sub><b>ZYSzys</b></sub>](http://zyszys.top)<br />[📖](https://github.com/CompuIves/codesandbox-client/commits?author=ZYSzys "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/1051509?v=4" width="100px;"/><br /><sub><b>Sara Vieira</b></sub>](http://iamsaravieira.com)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=SaraVieira "Code") [🎨](#design-SaraVieira "Design") [🤔](#ideas-SaraVieira "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/6137112?v=4" width="100px;"/><br /><sub><b>François Chalifour</b></sub>](https://francoischalifour.com)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Afrancoischalifour "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=francoischalifour "Code") | [<img src="https://avatars2.githubusercontent.com/u/5365325?v=4" width="100px;"/><br /><sub><b>Daniel Vu</b></sub>](https://twitter.com/dvv297)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=dv297 "Code") | [<img src="https://avatars3.githubusercontent.com/u/4931048?v=4" width="100px;"/><br /><sub><b>Vivek Nayyar</b></sub>](https://www.viveknayyar.in/)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=vivek12345 "Code") | [<img src="https://avatars3.githubusercontent.com/u/6244647?v=4" width="100px;"/><br /><sub><b>Bob Ziroll</b></sub>](https://github.com/bobziroll)<br />[📖](https://github.com/CompuIves/codesandbox-client/commits?author=bobziroll "Documentation") |
55-
54+
| [<img src="https://avatars1.githubusercontent.com/u/23313266?v=4" width="100px;"/><br /><sub><b>ZYSzys</b></sub>](http://zyszys.top)<br />[📖](https://github.com/CompuIves/codesandbox-client/commits?author=ZYSzys "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/1051509?v=4" width="100px;"/><br /><sub><b>Sara Vieira</b></sub>](http://iamsaravieira.com)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=SaraVieira "Code") [🎨](#design-SaraVieira "Design") [🤔](#ideas-SaraVieira "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/6137112?v=4" width="100px;"/><br /><sub><b>François Chalifour</b></sub>](https://francoischalifour.com)<br />[🐛](https://github.com/CompuIves/codesandbox-client/issues?q=author%3Afrancoischalifour "Bug reports") [💻](https://github.com/CompuIves/codesandbox-client/commits?author=francoischalifour "Code") | [<img src="https://avatars2.githubusercontent.com/u/5365325?v=4" width="100px;"/><br /><sub><b>Daniel Vu</b></sub>](https://twitter.com/dvv297)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=dv297 "Code") | [<img src="https://avatars3.githubusercontent.com/u/4931048?v=4" width="100px;"/><br /><sub><b>Vivek Nayyar</b></sub>](https://www.viveknayyar.in/)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=vivek12345 "Code") | [<img src="https://avatars3.githubusercontent.com/u/6244647?v=4" width="100px;"/><br /><sub><b>Bob Ziroll</b></sub>](https://github.com/bobziroll)<br />[📖](https://github.com/CompuIves/codesandbox-client/commits?author=bobziroll "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/640208?v=4" width="100px;"/><br /><sub><b>Alexander Lichter</b></sub>](https://blog.lichter.io)<br />[💻](https://github.com/CompuIves/codesandbox-client/commits?author=manniL "Code") |
5655
<!-- ALL-CONTRIBUTORS-LIST:END -->
5756

5857
## Backers

packages/app/src/app/components/CodeEditor/FuzzySearch/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { getModulePath } from 'common/sandbox/modules';
66
import Input from 'common/components/Input';
77
import EntryIcons from 'app/pages/Sandbox/Editor/Workspace/Files/DirectoryEntry/Entry/EntryIcons';
88
import getType from 'app/utils/get-type';
9-
9+
import { ESC } from 'common/utils/keycodes';
1010
import {
1111
Container,
1212
InputContainer,
@@ -61,7 +61,7 @@ export default class FuzzySearch extends React.PureComponent {
6161
};
6262

6363
handleKeyUp = e => {
64-
if (e.keyCode === 27) {
64+
if (e.keyCode === ESC) {
6565
this.props.closeFuzzySearch();
6666
}
6767
};

packages/app/src/app/components/Preview/AddressBar/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from 'react';
2+
import { ENTER } from 'common/utils/keycodes';
23
import { Container, InputContainer } from './elements';
34

45
export default class extends React.PureComponent {
@@ -11,8 +12,7 @@ export default class extends React.PureComponent {
1112
handleKeyDown = e => {
1213
const { onConfirm } = this.props;
1314

14-
if (e.keyCode === 13) {
15-
// Enter
15+
if (e.keyCode === ENTER) {
1616
onConfirm();
1717
}
1818
};

packages/app/src/app/components/Preview/DevTools/Console/Input/index.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import theme from 'common/theme';
88
import MonacoEditor from 'app/components/CodeEditor/Monaco/MonacoReactComponent';
99
import defineTheme from 'app/components/CodeEditor/Monaco/define-theme';
1010

11+
import { ARROW_UP, ARROW_DOWN, ENTER } from 'common/utils/keycodes';
12+
1113
import { IconContainer } from './elements';
1214

1315
const CONSOLE_INPUT_TOP_PADDING = 6;
@@ -142,8 +144,7 @@ class ConsoleInput extends React.PureComponent<Props, State> {
142144
const e = event.browserEvent;
143145
const { evaluateConsole } = this.props;
144146

145-
if (e.keyCode === 13) {
146-
// Enter
147+
if (e.keyCode === ENTER) {
147148
if (e.shiftKey) {
148149
return;
149150
}
@@ -156,8 +157,7 @@ class ConsoleInput extends React.PureComponent<Props, State> {
156157
commandCursor: -1,
157158
commandHistory: [command, ...this.state.commandHistory],
158159
});
159-
} else if (e.keyCode === 38) {
160-
// Up arrow
160+
} else if (e.keyCode === ARROW_UP) {
161161
const lineNumber = editor.getPosition().lineNumber;
162162
if (lineNumber !== 1) {
163163
return;
@@ -171,8 +171,7 @@ class ConsoleInput extends React.PureComponent<Props, State> {
171171
this.setState({
172172
commandCursor: newCursor,
173173
});
174-
} else if (e.keyCode === 40) {
175-
// Down arrow
174+
} else if (e.keyCode === ARROW_DOWN) {
176175
const lineNumber = editor.getPosition().lineNumber;
177176
const lineCount = editor.getModel().getLineCount();
178177
if (lineNumber !== lineCount) {

packages/app/src/app/pages/Dashboard/Content/CreateNewSandbox/Modal/Template/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import getIcon from 'common/templates/icons';
33

4+
import { ENTER } from 'common/utils/keycodes';
45
import { Container, IconContainer, Title, SubTitle } from './elements';
56

67
export default ({ template, subtitle, width, selectTemplate, small }) => {
@@ -16,7 +17,7 @@ export default ({ template, subtitle, width, selectTemplate, small }) => {
1617
color={template.color}
1718
width={width}
1819
onKeyDown={e => {
19-
if (e.keyCode === 13) {
20+
if (e.keyCode === ENTER) {
2021
select();
2122
}
2223
}}

packages/app/src/app/pages/Dashboard/Content/CreateNewSandbox/index.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Spring } from 'react-spring';
33
import { inject } from 'mobx-react';
44
import { ThemeProvider } from 'styled-components';
55
import history from 'app/utils/history';
6-
6+
import { ESC, ENTER } from 'common/utils/keycodes';
77
import theme from 'common/theme';
88
import { sandboxUrl } from 'common/utils/url-generator';
99
import Portal from 'common/components/Portal';
@@ -67,9 +67,7 @@ class CreateNewSandbox extends React.PureComponent {
6767
};
6868

6969
keydownListener = e => {
70-
if (e.keyCode === 27) {
71-
// Escape
72-
70+
if (e.keyCode === ESC) {
7371
this.close();
7472
}
7573
};
@@ -192,7 +190,7 @@ class CreateNewSandbox extends React.PureComponent {
192190
role="button"
193191
hide={this.state.creating}
194192
onKeyDown={e => {
195-
if (e.keyCode === 13) {
193+
if (e.keyCode === ENTER) {
196194
this.handleClick();
197195
}
198196
}}

packages/app/src/app/pages/Dashboard/Content/SandboxCard/index.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import getTemplate from 'common/templates';
1616
import theme from 'common/theme';
1717
import track from 'common/utils/analytics';
1818

19+
import { ESC, ENTER } from 'common/utils/keycodes';
1920
import { RENAME_SANDBOX_MUTATION } from '../../queries';
2021

2122
import {
@@ -304,7 +305,7 @@ class SandboxItem extends React.PureComponent<Props> {
304305
};
305306

306307
handleKeyDown = (e: KeyboardEvent) => {
307-
if (e.keyCode === 13) {
308+
if (e.keyCode === ENTER) {
308309
track('Dashboard - Sandbox Opened With Enter');
309310
// enter
310311
this.openSandbox();
@@ -485,14 +486,12 @@ class SandboxItem extends React.PureComponent<Props> {
485486
}
486487
}}
487488
onKeyDown={e => {
488-
if (e.keyCode === 13) {
489-
// Enter
489+
if (e.keyCode === ENTER) {
490490
e.preventDefault();
491491
e.stopPropagation();
492492

493493
saveName();
494-
} else if (e.keyCode === 27) {
495-
// Escape
494+
} else if (e.keyCode === ESC) {
496495
e.preventDefault();
497496
e.stopPropagation();
498497

packages/app/src/app/pages/Dashboard/Sidebar/SandboxesItem/FolderEntry/CreateFolderEntry.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Mutation } from 'react-apollo';
44
import AddFolderIcon from 'react-icons/lib/md/create-new-folder';
55
import Input from 'common/components/Input';
66
import track from 'common/utils/analytics';
7+
import { ESC } from 'common/utils/keycodes';
78

89
import {
910
CreateDirectoryContainer,
@@ -78,7 +79,7 @@ export default ({ basePath, teamId, noFocus, close, depth }) => {
7879
style={{ marginRight: '1rem' }}
7980
onBlur={close}
8081
onKeyDown={e => {
81-
if (e.keyCode === 27) {
82+
if (e.keyCode === ESC) {
8283
e.preventDefault();
8384
close();
8485
}

packages/app/src/app/pages/Dashboard/Sidebar/SandboxesItem/FolderEntry/index.js

+4-9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import theme from 'common/theme';
1919
import ContextMenu from 'app/components/ContextMenu';
2020

2121
import Input from 'common/components/Input';
22+
import { ARROW_LEFT, ARROW_RIGHT, ESC } from 'common/utils/keycodes';
2223

2324
import { Container, AnimatedChevron, IconContainer } from './elements';
2425

@@ -75,13 +76,9 @@ class FolderEntry extends React.Component {
7576

7677
handleKeyDown = e => {
7778
if (!this.state.renamingDirectory) {
78-
if (e.keyCode === 39) {
79-
// Right arrow
80-
79+
if (e.keyCode === ARROW_RIGHT) {
8180
this.setState({ open: true });
82-
} else if (e.keyCode === 37) {
83-
// Left arrow
84-
81+
} else if (e.keyCode === ARROW_LEFT) {
8582
this.setState({ open: false });
8683
}
8784
}
@@ -265,9 +262,7 @@ class FolderEntry extends React.Component {
265262
defaultValue={name}
266263
onBlur={this.handleBlur}
267264
onKeyDown={e => {
268-
if (e.keyCode === 27) {
269-
// Escape
270-
265+
if (e.keyCode === ESC) {
271266
this.handleBlur();
272267
}
273268
}}

packages/app/src/app/pages/Sandbox/Editor/Header/CollectionInfo/index.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Media from 'react-media';
66
import { Spring } from 'react-spring';
77

88
import track from 'common/utils/analytics';
9+
import { ESC } from 'common/utils/keycodes';
910

1011
import { Container, SandboxName, SandboxInput, FolderName } from './elements';
1112

@@ -41,9 +42,7 @@ class CollectionInfo extends React.Component {
4142
};
4243

4344
handleKeyUp = e => {
44-
if (e.keyCode === 27) {
45-
// esc
46-
45+
if (e.keyCode === ESC) {
4746
this.updateSandboxInfo();
4847
}
4948
};

0 commit comments

Comments
 (0)