2018-07-12 05:40:39 -07:00
|
|
|
import React from 'react'
|
2019-01-04 05:38:49 -08:00
|
|
|
import { FormInput } from '../FormInput'
|
|
|
|
import { FormSelect } from '../FormSelect'
|
|
|
|
import { inject, observer } from 'mobx-react'
|
2017-12-20 05:13:28 -08:00
|
|
|
|
2019-10-28 23:43:19 -07:00
|
|
|
@inject('ballotStore')
|
2017-12-20 05:13:28 -08:00
|
|
|
@observer
|
|
|
|
export class BallotProxyMetadata extends React.Component {
|
|
|
|
render() {
|
2019-10-28 23:43:19 -07:00
|
|
|
const { ballotStore, networkBranch } = this.props
|
2018-06-13 05:02:31 -07:00
|
|
|
let options = [
|
2019-01-25 10:04:16 -08:00
|
|
|
/*0*/ { value: '', label: '' },
|
|
|
|
/*1*/ { value: '1', label: ballotStore.ProxyBallotType[1] }, // KeysManager
|
|
|
|
/*2*/ { value: '2', label: ballotStore.ProxyBallotType[2] }, // VotingToChangeKeys
|
|
|
|
/*3*/ { value: '3', label: ballotStore.ProxyBallotType[3] }, // VotingToChangeMinThreshold
|
|
|
|
/*4*/ { value: '4', label: ballotStore.ProxyBallotType[4] }, // VotingToChangeProxy
|
|
|
|
/*5*/ { value: '5', label: ballotStore.ProxyBallotType[5] }, // BallotsStorage
|
|
|
|
/*6*/ { value: '7', label: ballotStore.ProxyBallotType[7] }, // ValidatorMetadata
|
|
|
|
/*7*/ { value: '8', label: ballotStore.ProxyBallotType[8] }, // ProxyStorage
|
|
|
|
/*8*/ { value: '9', label: ballotStore.ProxyBallotType[9] } // RewardByBlock
|
2018-07-12 05:40:39 -07:00
|
|
|
]
|
2018-06-13 05:02:31 -07:00
|
|
|
|
2017-12-20 05:13:28 -08:00
|
|
|
return (
|
2019-01-04 05:38:49 -08:00
|
|
|
<div className="frm-BallotProxyMetadata">
|
|
|
|
<div className="frm-BallotProxyMetadata_Row">
|
|
|
|
<FormInput
|
|
|
|
hint="Proposed address of a new proxy contract."
|
|
|
|
id="key"
|
|
|
|
networkBranch={networkBranch}
|
|
|
|
onChange={e => ballotStore.changeBallotMetadata(e, 'proposedAddress', 'ballotProxy')}
|
|
|
|
title="Proposed Address"
|
|
|
|
value={ballotStore.ballotProxy.proposedAddress}
|
|
|
|
/>
|
|
|
|
<FormSelect
|
|
|
|
hint="Choose proxy contract type."
|
|
|
|
id="contract-type"
|
|
|
|
networkBranch={networkBranch}
|
|
|
|
onChange={e => ballotStore.changeBallotMetadata(e, 'contractType', 'ballotProxy')}
|
|
|
|
options={options}
|
|
|
|
title="Contract Type"
|
|
|
|
value={ballotStore.ballotProxy.contractType}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div className="frm-BallotProxyMetadata_Row">
|
|
|
|
<FormInput
|
|
|
|
hint="Ballot's end time."
|
|
|
|
id="datetime-local"
|
|
|
|
networkBranch={networkBranch}
|
|
|
|
onChange={e => ballotStore.changeBallotMetadata(e, 'endTime')}
|
|
|
|
title="Ballot End"
|
|
|
|
type="datetime-local"
|
|
|
|
value={ballotStore.endTime}
|
|
|
|
/>
|
2017-12-20 05:13:28 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-07-12 05:40:39 -07:00
|
|
|
)
|
2017-12-20 05:13:28 -08:00
|
|
|
}
|
|
|
|
}
|