diff --git a/src/App.js b/src/App.js index dddd829..b977bd3 100644 --- a/src/App.js +++ b/src/App.js @@ -90,12 +90,20 @@ class App extends Component { return netId in constants.NETWORKS && constants.NETWORKS[netId].TESTNET ? 'sokol' : '' } + isNewBallotPage() { + return `${constants.rootPath}/new` === this.props.location.pathname + } + render() { const { commonStore, contractsStore } = this.props const networkBranch = this.getVotingNetworkBranch() return networkBranch ? ( -
{text}
+} diff --git a/src/components/KeysTypes/index.js b/src/components/KeysTypes/index.js index 747b791..0643b83 100644 --- a/src/components/KeysTypes/index.js +++ b/src/components/KeysTypes/index.js @@ -1,113 +1,98 @@ import React from 'react' import { inject, observer } from 'mobx-react' +import { FormHint } from '../FormHint' @inject('ballotStore') @observer export class KeysTypes extends React.Component { render() { - const { ballotStore } = this.props + const { ballotStore, networkBranch } = this.props + const keyButtons = [ + [ + { + checked: ballotStore.isAddKeysBallotType, + hint: 'Add new key.', + id: 'add-key', + name: 'key-control', + onChange: e => ballotStore.changeKeysBallotType(e, ballotStore.KeysBallotType.add), + text: 'Add key', + value: ballotStore.KeysBallotType.add + }, + { + checked: ballotStore.isRemoveKeysBallotType, + hint: 'Remove existing key.', + id: 'remove-key', + name: 'key-control', + onChange: e => ballotStore.changeKeysBallotType(e, ballotStore.KeysBallotType.remove), + text: 'Remove key', + value: ballotStore.KeysBallotType.remove + }, + { + checked: ballotStore.isSwapKeysBallotType, + hint: 'Remove existing key and add new key.', + id: 'swap-key', + name: 'key-control', + onChange: e => ballotStore.changeKeysBallotType(e, ballotStore.KeysBallotType.swap), + text: 'Swap key', + value: ballotStore.KeysBallotType.swap + } + ], + [ + { + checked: ballotStore.isMiningKeyType, + hint: 'Mining key type.', + id: 'mining-key', + name: 'keys', + onChange: e => ballotStore.changeKeyType(e, ballotStore.KeyType.mining), + text: 'Mining Key', + value: ballotStore.KeyType.mining + }, + { + checked: ballotStore.isPayoutKeyType, + hint: 'Payout key type.', + id: 'payout-key', + name: 'keys', + onChange: e => ballotStore.changeKeyType(e, ballotStore.KeyType.payout), + text: 'Payout Key', + value: ballotStore.KeyType.payout + }, + { + checked: ballotStore.isVotingKeyType, + hint: 'Voting key type.', + id: 'voting-key', + name: 'keys', + onChange: e => ballotStore.changeKeyType(e, ballotStore.KeyType.voting), + text: 'Voting Key', + value: ballotStore.KeyType.voting + } + ] + ] + return ( -Add new key.
+Remove existing key.
-Remove existing key and add new key.
-Mining key type.
-Payout key type.
-Voting key type.
-