Move editor from app-js to ui-app component (#795)

* Move editor from app-js to ui-app component

* move export

* Move codeflask in package.json
This commit is contained in:
Stefanie Doll 2019-03-08 12:41:58 +01:00 committed by GitHub
parent 7c6b190c4b
commit 4ff77eee26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 8 deletions

View File

@ -12,7 +12,6 @@
"dependencies": {
"@babel/runtime": "^7.3.4",
"@polkadot/ui-app": "^0.24.36",
"codeflask": "1.4.0",
"snappyjs": "^0.6.0"
}
}

View File

@ -13,7 +13,7 @@ import { withRouter } from 'react-router';
import { Transition } from 'semantic-ui-react';
import snappy from 'snappyjs';
import { withApi, withMulti } from '@polkadot/ui-api/index';
import { Button, Dropdown } from '@polkadot/ui-app/index';
import { Button, Dropdown, Editor } from '@polkadot/ui-app/index';
import uiKeyring from '@polkadot/ui-keyring';
import * as util from '@polkadot/util';
import * as hashing from '@polkadot/util-crypto';
@ -24,7 +24,6 @@ import snippets from './snippets';
import translate from './translate';
import { STORE_EXAMPLES, STORE_SELECTED, CUSTOM_LABEL } from './constants';
import Editor from './Editor';
import Output from './Output';
import ActionButtons from './ActionButtons';
@ -110,7 +109,7 @@ class Playground extends React.PureComponent<Props, State> {
}
render () {
const { isDevelopment, t } = this.props;
const { t } = this.props;
const { animated, isCustomExample, isRunning, logs, options, selected } = this.state;
const snippetName = selected.type === 'custom' ? selected.text : undefined;
@ -130,7 +129,6 @@ class Playground extends React.PureComponent<Props, State> {
<article className='container js--Editor'>
<Editor
code={selected.code}
isDevelopment={isDevelopment}
onEdit={this.onEdit}
/>
<ActionButtons

View File

@ -23,6 +23,7 @@
"@types/react-dropzone": "^4.2.2",
"@types/react-router-dom": "^4.3.0q",
"chart.js": "^2.7.2",
"codeflask": "^1.4.0",
"i18next": "^15.0.4",
"i18next-browser-languagedetector": "^3.0.1",
"i18next-xhr-backend": "^2.0.1",

View File

@ -1,4 +1,4 @@
// Copyright 2017-2019 @polkadot/app-js authors & contributors
// Copyright 2017-2019 @polkadot/ui-app authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.

View File

@ -1,4 +1,4 @@
// Copyright 2017-2019 @polkadot/app-js authors & contributors
// Copyright 2017-2019 @polkadot/ui-app authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
@ -8,7 +8,6 @@ import React from 'react';
import CodeFlask from 'codeflask';
type Props = BareProps & {
isDevelopment: boolean,
code: string,
onEdit: (code: string) => void
};

View File

@ -13,6 +13,7 @@ export { default as CardSummary } from './CardSummary';
export { default as Chart } from './Chart';
export { default as CopyButton } from './CopyButton';
export { default as Dropdown } from './Dropdown';
export { default as Editor } from './Editor';
export { default as Event } from './Event';
export { default as Icon } from './Icon';
export { default as IdentityIcon } from './IdentityIcon';