From f33b4b7f91b1e0c8bbf7ef5f2f954322be2baf31 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 24 Sep 2019 13:33:49 +0200 Subject: [PATCH] Rework js-app with func. components (#1651) --- packages/app-accounts/src/modals/Create.tsx | 178 +++-- packages/app-js/src/ActionButtons.tsx | 45 +- packages/app-js/src/Output.tsx | 45 +- packages/app-js/src/Playground.tsx | 653 +++++++++--------- packages/app-js/src/index.css | 142 ---- packages/app-js/src/index.tsx | 1 - packages/app-js/src/snippets/rpc-examples.ts | 2 +- .../react-components/src/Button/Divider.tsx | 18 +- packages/react-components/src/Editor.tsx | 52 +- 9 files changed, 525 insertions(+), 611 deletions(-) delete mode 100644 packages/app-js/src/index.css diff --git a/packages/app-accounts/src/modals/Create.tsx b/packages/app-accounts/src/modals/Create.tsx index 7b01054fde..b453073488 100644 --- a/packages/app-accounts/src/modals/Create.tsx +++ b/packages/app-accounts/src/modals/Create.tsx @@ -149,7 +149,18 @@ class Create extends React.PureComponent { public render (): React.ReactNode { const { className, t } = this.props; - const { address, isValid, showWarning } = this.state; + const { address, deriveError, derivePath, isNameValid, isPassValid, isSeedValid, isValid, name, pairType, password, seed, seedOptions, seedType, showWarning } = this.state; + const isDevSeed = seedType === 'dev'; + const seedLabel = ((): string => { + switch (seedType) { + case 'bip': + return t('mnemonic seed'); + case 'dev': + return t('development seed'); + default: + return t('seed (hex or string)'); + } + })(); return ( { onHideWarning={this.onHideWarning} /> )} - {this.renderInput()} + + + + + + + +
+ {t('Advanced creation options')} + + //". The "/" and "//" may be repeated and mixed`.')} + isError={!!deriveError} + label={t('secret derivation path')} + onChange={this.onChangeDerive} + onEnter={this.onCommit} + value={derivePath} + /> + {deriveError && ( +
{deriveError}
+ )} +
+
+