Skip to content
This repository has been archived by the owner on Jan 19, 2018. It is now read-only.

Commit

Permalink
Update dapp
Browse files Browse the repository at this point in the history
  • Loading branch information
ngotchac committed Nov 27, 2017
1 parent 4abe40a commit 8f25fe0
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 27 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"mobx-react": "^4.3.5",
"react": "16.1.1",
"react-codemirror": "1.0.0",
"react-codemirror2": "3.0.7",
"react-dom": "16.1.1",
"react-element-to-jsx-string": "13.1.0",
"react-event-listener": "^0.5.1",
Expand Down
1 change: 1 addition & 0 deletions src/Application/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pre {
display: flex;
flex: 1;
flex-direction: column;
overflow: hidden;
}

.eval {
Expand Down
2 changes: 2 additions & 0 deletions src/Snippets/snippets.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
display: flex;
flex: 1;
flex-direction: row;
overflow: hidden;
}

.panel {
Expand Down Expand Up @@ -57,6 +58,7 @@
display: flex;
flex: 1;
flex-direction: column;
overflow: hidden;

> * {
flex: 1;
Expand Down
51 changes: 27 additions & 24 deletions src/Snippets/snippets.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import keycode from 'keycode';
import { observer } from 'mobx-react';
import React, { Component } from 'react';
import CodeMirror from 'react-codemirror';
// import CodeMirror from 'react-codemirror';
import { Controlled as CodeMirror } from 'react-codemirror2';
import EventListener from 'react-event-listener';

import Console from '../Console';
Expand Down Expand Up @@ -51,24 +52,26 @@ export default class Snippets extends Component {
</div>
</div>
<div className={ styles.code }>
<CodeMirror
ref={ this.setRef }
onChange={ this.handleChange }
options={ {
autofocus: true,
extraKeys: {
'Ctrl-Space': 'autocomplete'
},
keyMap: 'sublime',
highlightSelectionMatches: {
delay: 0,
showToken: false
},
lineNumbers: true,
mode: 'javascript'
} }
value={ code }
/>
<div>
<CodeMirror
ref={ this.setRef }
onChange={ this.handleChange }
options={ {
autofocus: true,
extraKeys: {
'Ctrl-Space': 'autocomplete'
},
keyMap: 'sublime',
highlightSelectionMatches: {
delay: 0,
showToken: false
},
lineNumbers: true,
mode: 'javascript'
} }
value={ code }
/>
</div>
<div className={ styles.console }>
<Console />
</div>
Expand Down Expand Up @@ -207,12 +210,12 @@ export default class Snippets extends Component {
this.snippetsStore.select(id);
};

setRef = (node) => {
const codeMirror = node
? node.getCodeMirror()
: null;
setRef = () => {
// const codeMirror = node
// ? node.getCodeMirror()
// : null;

this.snippetsStore.setCodeMirror(codeMirror);
// this.snippetsStore.setCodeMirror(codeMirror);
};

stopPropagation = (event) => {
Expand Down
4 changes: 2 additions & 2 deletions src/Snippets/snippets.store.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import keycode from 'keycode';
import { action, computed, map, observable, transaction } from 'mobx';
import { action, computed, observable, transaction } from 'mobx';
import store from 'store';

import { evaluate } from '../utils';
Expand All @@ -25,7 +25,7 @@ const LS_SNIPPETS_KEY = '_console::snippets';
let instance;

export default class SnippetsStore {
@observable files = map();
@observable files = observable.map();
@observable nextName = null;
@observable renaming = null;
@observable selected = null;
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.

import 'codemirror/lib/codemirror.css';
import 'codemirror/addon/dialog/dialog';
import 'codemirror/addon/dialog/dialog.css';
import 'codemirror/addon/hint/javascript-hint';
Expand All @@ -23,7 +24,6 @@ import 'codemirror/addon/search/match-highlighter';
import 'codemirror/addon/search/search';
import 'codemirror/addon/search/searchcursor';
import 'codemirror/keymap/sublime';
import 'codemirror/lib/codemirror.css';
import 'codemirror/mode/javascript/javascript';

// Custom codemirror style
Expand Down

0 comments on commit 8f25fe0

Please sign in to comment.