(add) Consensus Threshold Ballot component layout

This commit is contained in:
Gabriel Rodriguez Alsina 2019-01-04 10:25:47 -03:00
parent 490be1fb8d
commit 3f445d6bfb
5 changed files with 41 additions and 30 deletions

View File

@ -0,0 +1,15 @@
.frm-BallotMinThresholdMetadata {
margin-bottom: $base-grid-gap;
}
.frm-BallotMinThresholdMetadata_Row {
@include form-row-base-styles();
display: grid;
grid-row-gap: $base-grid-gap;
grid-template-columns: 1fr;
@media (min-width: $breakpoint-xxl) {
grid-column-gap: $base-grid-gap;
grid-template-columns: 1fr 1fr;
}
}

View File

@ -5,6 +5,7 @@
@import "BallotFooter"; @import "BallotFooter";
@import "BallotInfoContainer"; @import "BallotInfoContainer";
@import "BallotKeysMetadata"; @import "BallotKeysMetadata";
@import "BallotMinThresholdMetadata";
@import "Ballots"; @import "Ballots";
@import "BaseLoader"; @import "BaseLoader";
@import "ButtonAddBallot"; @import "ButtonAddBallot";

File diff suppressed because one or more lines are too long

View File

@ -1,40 +1,35 @@
import React from 'react' import React from 'react'
import { FormInput } from '../FormInput'
import { inject, observer } from 'mobx-react' import { inject, observer } from 'mobx-react'
@inject('ballotStore') @inject('ballotStore')
@observer @observer
export class BallotMinThresholdMetadata extends React.Component { export class BallotMinThresholdMetadata extends React.Component {
render() { render() {
const { ballotStore } = this.props const { ballotStore, networkBranch } = this.props
return ( return (
<div> <div className="frm-BallotMinThresholdMetadata">
<div className="hidden"> <div className="frm-BallotMinThresholdMetadata_Row">
<div className="left"> <FormInput
<div className="form-el"> hint="Proposed value of the minimum threshold for keys ballot consensus."
<label htmlFor="key">Proposed Value</label> id="key"
<input networkBranch={networkBranch}
type="number" onChange={e => ballotStore.changeBallotMetadata(e, 'proposedValue', 'ballotMinThreshold')}
id="key" title="Proposed Value"
value={ballotStore.ballotMinThreshold.proposedValue} type="number"
onChange={e => ballotStore.changeBallotMetadata(e, 'proposedValue', 'ballotMinThreshold')} value={ballotStore.ballotMinThreshold.proposedValue}
/> />
<p className="hint">Proposed value of the minimum threshold for keys ballot consensus.</p> <FormInput
</div> hint="Ballot's end time."
</div> id="datetime-local"
<div className="right"> networkBranch={networkBranch}
<div className="form-el"> onChange={e => ballotStore.changeBallotMetadata(e, 'endTime')}
<label htmlFor="datetime-local">Ballot End</label> title="Ballot End"
<input type="datetime-local"
type="datetime-local" value={ballotStore.endTime}
id="datetime-local" />
value={ballotStore.endTime}
onChange={e => ballotStore.changeBallotMetadata(e, 'endTime')}
/>
<p className="hint">Ballot's end time.</p>
</div>
</div>
</div> </div>
<hr />
</div> </div>
) )
} }

View File

@ -430,7 +430,7 @@ export class NewBallot extends React.Component {
minThreshold = contractsStore.keysBallotThreshold minThreshold = contractsStore.keysBallotThreshold
break break
case ballotStore.BallotType.minThreshold: case ballotStore.BallotType.minThreshold:
metadata = <BallotMinThresholdMetadata /> metadata = <BallotMinThresholdMetadata networkBranch={networkBranch} />
minThreshold = contractsStore.minThresholdBallotThreshold minThreshold = contractsStore.minThresholdBallotThreshold
break break
case ballotStore.BallotType.proxy: case ballotStore.BallotType.proxy: