(Refactor) A few enhancements of code
This commit is contained in:
parent
c8009db1fd
commit
df60ea1683
|
@ -6,7 +6,7 @@ import { BallotCard } from './BallotCard.jsx'
|
|||
@observer
|
||||
export class BallotEmissionFundsCard extends React.Component {
|
||||
render() {
|
||||
let { id, votingState, pos, contractsStore } = this.props
|
||||
const { id, votingState, pos, contractsStore } = this.props
|
||||
const amount = contractsStore.web3Instance.fromWei(votingState.amount, 'ether')
|
||||
return (
|
||||
<BallotCard votingType="votingToManageEmissionFunds" votingState={votingState} id={id} pos={pos}>
|
||||
|
|
|
@ -93,7 +93,7 @@ export class BallotEmissionFundsMetadata extends React.Component {
|
|||
onChange={e => ballotStore.changeBallotMetadata(e, 'receiver', 'ballotEmissionFunds')}
|
||||
/>
|
||||
<p className="hint">
|
||||
The address to which the funds will be sent if `Send` operation obtains the majority of votes.
|
||||
The address which the funds will be sent to, in case of the majority of votes.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -53,7 +53,7 @@ export class NewBallot extends React.Component {
|
|||
.add(minBallotDurationInHours, 'hours')
|
||||
.format()
|
||||
let neededMinutes = moment(minEndTime).diff(moment(ballotStore.endTime), 'minutes')
|
||||
let neededHours = Math.floor(neededMinutes / 60)
|
||||
const neededHours = Math.floor(neededMinutes / 60)
|
||||
let duration = moment.unix(ballotStore.endTimeUnix).diff(moment.unix(startTime), 'hours')
|
||||
|
||||
if (duration < 0) {
|
||||
|
@ -75,7 +75,7 @@ export class NewBallot extends React.Component {
|
|||
.utc()
|
||||
.add(14, 'days')
|
||||
.format()
|
||||
let exceededMinutes = moment(ballotStore.endTime).diff(moment(twoWeeks), 'minutes')
|
||||
const exceededMinutes = moment(ballotStore.endTime).diff(moment(twoWeeks), 'minutes')
|
||||
if (exceededMinutes > 0) {
|
||||
swal('Warning!', messages.SHOULD_BE_LESS_OR_EQUAL_14_DAYS(duration), 'warning')
|
||||
commonStore.hideLoading()
|
||||
|
@ -177,8 +177,8 @@ export class NewBallot extends React.Component {
|
|||
createBallotForKeys = (startTime, endTime) => {
|
||||
const { ballotStore, contractsStore } = this.props
|
||||
const inputToMethod = {
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
startTime,
|
||||
endTime,
|
||||
affectedKey: ballotStore.ballotKeys.affectedKey,
|
||||
affectedKeyType: ballotStore.ballotKeys.keyType,
|
||||
newVotingKey: ballotStore.ballotKeys.newVotingKey,
|
||||
|
@ -203,8 +203,8 @@ export class NewBallot extends React.Component {
|
|||
createBallotForMinThreshold = (startTime, endTime) => {
|
||||
const { ballotStore, contractsStore } = this.props
|
||||
const inputToMethod = {
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
startTime,
|
||||
endTime,
|
||||
proposedValue: ballotStore.ballotMinThreshold.proposedValue,
|
||||
memo: ballotStore.memo
|
||||
}
|
||||
|
@ -214,8 +214,8 @@ export class NewBallot extends React.Component {
|
|||
createBallotForProxy = (startTime, endTime) => {
|
||||
const { ballotStore, contractsStore } = this.props
|
||||
const inputToMethod = {
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
startTime,
|
||||
endTime,
|
||||
proposedValue: ballotStore.ballotProxy.proposedAddress,
|
||||
contractType: ballotStore.ballotProxy.contractType,
|
||||
memo: ballotStore.memo
|
||||
|
@ -226,8 +226,8 @@ export class NewBallot extends React.Component {
|
|||
createBallotForEmissionFunds = (startTime, endTime) => {
|
||||
const { ballotStore, contractsStore } = this.props
|
||||
const inputToMethod = {
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
startTime,
|
||||
endTime,
|
||||
receiver: ballotStore.ballotEmissionFunds.receiver,
|
||||
memo: ballotStore.memo
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue