First-pass on submission there

This commit is contained in:
Jaco Greeff 2018-04-19 17:29:25 +02:00
parent c13a12c1a7
commit 6ccef75454
20 changed files with 131 additions and 42 deletions

View File

@ -1,11 +1,3 @@
{
"extends": "@polkadot/dev/config/babel",
"plugins": [
["module-resolver", {
"alias": {
"^@polkadot/portal-(chains|db-chain|db|p2p|rpc|runtime|state|wasm)(.*)": "./packages/portal-\\1/src\\2",
"^@polkadot/portal": "./packages/portal/src"
}
}]
]
"extends": "@polkadot/dev/config/babel"
}

View File

@ -8,13 +8,13 @@
"build": "cd packages/portal && react-scripts build",
"check": "eslint packages && flow check",
"start": "cd packages/portal && react-scripts start",
"test": "jest --coverage"
"test": "echo 'to tests executed'"
},
"dependencies": {
"@polkadot/portal": "^0.1.0"
},
"devDependencies": {
"@polkadot/dev": "^0.17.8",
"@polkadot/dev": "^0.17.9",
"lerna": "^2.5.1",
"react-scripts": "^2.0.0-next.b2fd8db8"
},

View File

@ -13,7 +13,7 @@
"test": "react-scripts test --env=jsdom --coverage"
},
"devDependencies": {
"@polkadot/rx-react": "^0.2.9",
"@polkadot/rx-react": "^0.2.13",
"@polkadot/util": "^0.19.1",
"react": "^16.3.1",
"react-dom": "^16.3.1",

View File

@ -13,7 +13,7 @@
"test": "react-scripts test --env=jsdom --coverage"
},
"devDependencies": {
"@polkadot/rx-react": "^0.2.9",
"@polkadot/rx-react": "^0.2.13",
"@polkadot/ui-react": "^0.9.10",
"@polkadot/util": "^0.19.1",
"@polkadot/util-keyring": "^0.19.1",

View File

@ -34,7 +34,10 @@ export default function Account ({ className, label, subject, style }: Props) {
</div>
<div className='small'>
<Label>with an available balance of</Label>
<AccountBalance className='ui disabled dropdown selection' />
<AccountBalance
className='ui disabled dropdown selection'
classNameUpdated='hasUpdated'
/>
</div>
</div>
);

View File

@ -12,7 +12,7 @@
}
.testing--CallDisplay-Component {
margin-bottom: 1.5rem;
margin: 1.5rem 0;
}
.testing--CallDisplay-Button {}

View File

@ -12,7 +12,9 @@ import React from 'react';
import Button from 'semantic-ui-react/dist/es/elements/Button';
import withObservable from '@polkadot/rx-react/with/observable';
import StakingTransfer from '../StakingTransfer';
import StakingStake from '../Staking/Stake';
import StakingTransfer from '../Staking/Transfer';
import StakingUnstake from '../Staking/Unstake';
import { extrinsicName } from '../subjects';
import ErrorComponent from './Error';
import submitExtrinsic from './submit';
@ -26,7 +28,9 @@ type Props = BaseProps & {
};
const COMPONENTS = {
'staking_transfer': StakingTransfer
'staking_stake': StakingStake,
'staking_transfer': StakingTransfer,
'staking_unstake': StakingUnstake
};
function CallDisplay ({ className, style, value }: Props, { api }: BaseContext) {

View File

@ -38,6 +38,7 @@ export default function Nonce ({ className, style }: Props) {
<Label>with an index</Label>
<SenderNonce
className='ui disabled dropdown selection'
classNameUpdated='hasUpdated'
onChange={onNonceChange}
/>
</div>

View File

@ -0,0 +1,8 @@
// Copyright 2017-2018 Jaco Greeff
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
// @flow
export default function getValues (): Array<mixed> {
return [];
}

View File

@ -0,0 +1,25 @@
// Copyright 2017-2018 Jaco Greeff
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
// @flow
import type { BaseProps } from '../../types';
import React from 'react';
import getValues from './getValues';
type Props = BaseProps & {};
function StakingStake ({ className, style }: Props) {
return (
<div
className={['testing--StakingStake', className].join(' ')}
style={style}
/>
);
}
StakingStake.getValues = getValues;
export default StakingStake;

View File

@ -3,7 +3,7 @@
// of the ISC license. See the LICENSE file for details.
// @flow
import type { BaseProps } from '../types';
import type { BaseProps } from '../../types';
import BN from 'bn.js';
import React from 'react';

View File

@ -3,7 +3,7 @@
// of the ISC license. See the LICENSE file for details.
// @flow
import { recipientAddr } from '../subjects';
import { recipientAddr } from '../../subjects';
import { amount } from './subjects';
export default function getValues (): Array<mixed> {

View File

@ -3,13 +3,11 @@
// of the ISC license. See the LICENSE file for details.
// @flow
import type { BaseProps } from '../types';
import './StakingTransfer.css';
import type { BaseProps } from '../../types';
import React from 'react';
import Recipient from '../Recipient';
import Recipient from '../../Recipient';
import Amount from './Amount';
import getValues from './getValues';

View File

@ -0,0 +1,8 @@
// Copyright 2017-2018 Jaco Greeff
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
// @flow
export default function getValues (): Array<mixed> {
return [];
}

View File

@ -0,0 +1,25 @@
// Copyright 2017-2018 Jaco Greeff
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
// @flow
import type { BaseProps } from '../../types';
import React from 'react';
import getValues from './getValues';
type Props = BaseProps & {};
function StakingUnstake ({ className, style }: Props) {
return (
<div
className={['testing--StakingUnstake', className].join(' ')}
style={style}
/>
);
}
StakingUnstake.getValues = getValues;
export default StakingUnstake;

View File

@ -1,7 +0,0 @@
/* Copyright 2017-2018 Jaco Greeff
/* This software may be modified and distributed under the terms
/* of the ISC license. See the LICENSE file for details. */
.testing--StakingTransfer {
margin-top: 1.5rem;
}

View File

@ -39,3 +39,8 @@
flex: 0 25%;
min-width: 0;
}
.hasUpdated {
background: #ffffe0 !important;
transition: all 0.7s ease-in-out;
}

View File

@ -16,7 +16,7 @@
"devDependencies": {
"@polkadot/app-home": "^0.1.0",
"@polkadot/app-testing": "^0.1.0",
"@polkadot/rx-react": "^0.2.9",
"@polkadot/rx-react": "^0.2.13",
"@polkadot/ui-react": "^0.9.10",
"i18next": "^11.1.1",
"i18next-browser-languagedetector": "^2.2.0",

View File

@ -1212,9 +1212,9 @@
"@polkadot/util" "^0.18.6"
babel-runtime "^6.26.0"
"@polkadot/dev@^0.17.8":
version "0.17.8"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.17.8.tgz#d22daea75e88587250c4f8d7ebdda1dd957570df"
"@polkadot/dev@^0.17.9":
version "0.17.9"
resolved "https://registry.yarnpkg.com/@polkadot/dev/-/dev-0.17.9.tgz#12316416384eb3da5e926f2e875902a3c8e4e5a3"
dependencies:
babel-cli "^6.26.0"
babel-core "^6.26.0"
@ -1299,19 +1299,19 @@
"@polkadot/util" "^0.18.4"
babel-runtime "^6.26.0"
"@polkadot/rx-api@^0.2.9":
version "0.2.9"
resolved "https://registry.yarnpkg.com/@polkadot/rx-api/-/rx-api-0.2.9.tgz#b495cab218fd80bd7d8090b0898b689fcca16e4f"
"@polkadot/rx-api@^0.2.13":
version "0.2.13"
resolved "https://registry.yarnpkg.com/@polkadot/rx-api/-/rx-api-0.2.13.tgz#94004e0e3a134bf75f50e0b22e5fa59c136db0e1"
dependencies:
"@polkadot/api" "^0.8.14"
"@polkadot/api-provider" "^0.8.14"
rxjs "^5.5.10"
"@polkadot/rx-react@^0.2.9":
version "0.2.9"
resolved "https://registry.yarnpkg.com/@polkadot/rx-react/-/rx-react-0.2.9.tgz#55a37178d47bc53b42fbe948c136483b2e9e7377"
"@polkadot/rx-react@^0.2.13":
version "0.2.13"
resolved "https://registry.yarnpkg.com/@polkadot/rx-react/-/rx-react-0.2.13.tgz#291e7e18eeaeea4dc3d16e50d932ca46da9c492d"
dependencies:
"@polkadot/rx-api" "^0.2.9"
"@polkadot/rx-api" "^0.2.13"
"@polkadot/util" "^0.19.1"
"@polkadot/ui-identicon@^0.9.10":
@ -2091,6 +2091,16 @@ babel-plugin-macros@2.0.0:
dependencies:
cosmiconfig "3.1.0"
babel-plugin-module-resolver@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/babel-plugin-module-resolver/-/babel-plugin-module-resolver-3.1.1.tgz#881cf67e3d4b8400d5eaaefc1be44d2dc1fe404f"
dependencies:
find-babel-config "^1.1.0"
glob "^7.1.2"
pkg-up "^2.0.0"
reselect "^3.0.1"
resolve "^1.4.0"
babel-plugin-named-asset-import@1.0.0-next.b2fd8db8:
version "1.0.0-next.b2fd8db8"
resolved "https://registry.yarnpkg.com/babel-plugin-named-asset-import/-/babel-plugin-named-asset-import-1.0.0-next.b2fd8db8.tgz#bd32f356288cbab326196b5f75547bc0dedf540a"
@ -4920,6 +4930,13 @@ finalhandler@1.1.1:
statuses "~1.4.0"
unpipe "~1.0.0"
find-babel-config@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/find-babel-config/-/find-babel-config-1.1.0.tgz#acc01043a6749fec34429be6b64f542ebb5d6355"
dependencies:
json5 "^0.5.1"
path-exists "^3.0.0"
find-cache-dir@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9"
@ -8066,7 +8083,7 @@ pkg-dir@^2.0.0:
dependencies:
find-up "^2.1.0"
pkg-up@2.0.0:
pkg-up@2.0.0, pkg-up@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/pkg-up/-/pkg-up-2.0.0.tgz#c819ac728059a461cab1c3889a2be3c49a004d7f"
dependencies:
@ -9238,6 +9255,10 @@ requires-port@1.0.x, requires-port@1.x.x, requires-port@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
reselect@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/reselect/-/reselect-3.0.1.tgz#efdaa98ea7451324d092b2b2163a6a1d7a9a2147"
resolve-cwd@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-2.0.0.tgz#00a9f7387556e27038eae232caa372a6a59b665a"
@ -9281,6 +9302,12 @@ resolve@^1.3.2, resolve@^1.3.3, resolve@^1.5.0:
dependencies:
path-parse "^1.0.5"
resolve@^1.4.0:
version "1.7.1"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.7.1.tgz#aadd656374fd298aee895bc026b8297418677fd3"
dependencies:
path-parse "^1.0.5"
restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"