diff --git a/src/App.js b/src/App.js index 7bb1fe9..603cc2c 100644 --- a/src/App.js +++ b/src/App.js @@ -29,22 +29,29 @@ class App extends Component { return ; } + onSearch = (e) => { + const { commonStore } = this.props; + commonStore.setSearchTerm(e.target.value.toLowerCase()); + } + render() { const { commonStore } = this.props; const loading = commonStore.loading ? : '' + const currentPath = this.props.location.pathname; + const nav = (currentPath == `${commonStore.rootPath}` || currentPath == `${commonStore.rootPath}/active`) ?
+
+
+ All + Active +
+ +
+
: null; return (
{loading}
-
-
-
- All - Active -
- -
-
+ {nav} diff --git a/src/Loading.js b/src/Loading.js index eeff234..afc664a 100644 --- a/src/Loading.js +++ b/src/Loading.js @@ -1,4 +1,4 @@ -import React, { Component } from 'react'; +import React from 'react'; const Loading = () => (
diff --git a/src/assets/App.css b/src/assets/App.css index 9061dc6..e0c1473 100644 --- a/src/assets/App.css +++ b/src/assets/App.css @@ -162,6 +162,7 @@ hr { padding: 0 10px; } } .title { + margin-top: 30px; margin-bottom: 30px; color: #38454f; font-size: 30px; @@ -456,7 +457,6 @@ button { margin-top: 20px; } } .search { - margin-bottom: 30px; border-bottom: 1px solid #eee; background-color: #fff; line-height: 80px; diff --git a/src/assets/src/assets/App.css b/src/assets/src/assets/App.css index 9061dc6..e0c1473 100644 --- a/src/assets/src/assets/App.css +++ b/src/assets/src/assets/App.css @@ -162,6 +162,7 @@ hr { padding: 0 10px; } } .title { + margin-top: 30px; margin-bottom: 30px; color: #38454f; font-size: 30px; @@ -456,7 +457,6 @@ button { margin-top: 20px; } } .search { - margin-bottom: 30px; border-bottom: 1px solid #eee; background-color: #fff; line-height: 80px; diff --git a/src/assets/stylesheets/base.scss b/src/assets/stylesheets/base.scss index 75db9db..84a63d8 100644 --- a/src/assets/stylesheets/base.scss +++ b/src/assets/stylesheets/base.scss @@ -93,6 +93,7 @@ hr { } .title { + margin-top: 30px; margin-bottom: 30px; color: #38454f; font-size: 30px; diff --git a/src/assets/stylesheets/search.scss b/src/assets/stylesheets/search.scss index 45414e8..3c8228d 100644 --- a/src/assets/stylesheets/search.scss +++ b/src/assets/stylesheets/search.scss @@ -1,5 +1,4 @@ .search { - margin-bottom: 30px; border-bottom: 1px solid #eee; background-color: #fff; line-height: 80px; diff --git a/src/components/BallotKeysCard.jsx b/src/components/BallotKeysCard.jsx index 245c420..9a58736 100644 --- a/src/components/BallotKeysCard.jsx +++ b/src/components/BallotKeysCard.jsx @@ -45,7 +45,7 @@ export class BallotKeysCard extends React.Component { @action("Get ballotTypeDisplayName") getBallotTypeDisplayName(ballotType) { const { ballotStore } = this.props; - switch(parseInt(ballotType)) { + switch(parseInt(ballotType, 10)) { case ballotStore.KeysBallotType.add: this.ballotTypeDisplayName = "add"; break; @@ -64,7 +64,7 @@ export class BallotKeysCard extends React.Component { @action("Get affectedKeyTypeDisplayName") getAffectedKeyTypeDisplayName(affectedKeyType) { const { ballotStore } = this.props; - switch(parseInt(affectedKeyType)) { + switch(parseInt(affectedKeyType, 10)) { case ballotStore.KeyType.mining: this.affectedKeyTypeDisplayName = "mining"; break; @@ -269,7 +269,6 @@ export class BallotKeysCard extends React.Component { let { commonStore, contractsStore } = this.props; let ballotClass = (commonStore.filtered && this.isFinalized) ? "ballots-i display-none" : "ballots-i"; console.log(this.isFinalized) - let additionalProps = this.isFinalized ? { disabled: true } : {}; return (
diff --git a/src/components/BallotKeysMetadata.jsx b/src/components/BallotKeysMetadata.jsx index 26b175a..a36570f 100644 --- a/src/components/BallotKeysMetadata.jsx +++ b/src/components/BallotKeysMetadata.jsx @@ -11,7 +11,7 @@ export class BallotKeysMetadata extends React.Component {
- + ballotStore.changeBallotMetadata(e, "affectedKey", "ballotKeys")} @@ -23,7 +23,7 @@ export class BallotKeysMetadata extends React.Component {
- + ballotStore.changeBallotMetadata(e, "miningKey", "ballotKeys")} @@ -35,7 +35,7 @@ export class BallotKeysMetadata extends React.Component {
- + ballotStore.changeBallotMetadata(e, "memo", "ballotKeys")} @@ -47,7 +47,7 @@ export class BallotKeysMetadata extends React.Component {
- + ballotStore.changeBallotMetadata(e, "endTime")} diff --git a/src/components/BallotMinThresholdCard.jsx b/src/components/BallotMinThresholdCard.jsx index aa70c3f..7ad3f35 100644 --- a/src/components/BallotMinThresholdCard.jsx +++ b/src/components/BallotMinThresholdCard.jsx @@ -187,7 +187,6 @@ export class BallotMinThresholdCard extends React.Component { render () { let { commonStore, contractsStore } = this.props; let ballotClass = (commonStore.filtered && this.isFinalized) ? "ballots-i display-none" : "ballots-i"; - let additionalProps = this.isFinalized ? { disabled: true } : {}; return (
diff --git a/src/components/BallotMinThresholdMetadata.jsx b/src/components/BallotMinThresholdMetadata.jsx index 09285f5..e8dc9df 100644 --- a/src/components/BallotMinThresholdMetadata.jsx +++ b/src/components/BallotMinThresholdMetadata.jsx @@ -11,7 +11,7 @@ export class BallotMinThresholdMetadata extends React.Component {
- + ballotStore.changeBallotMetadata(e, "proposedValue", "ballotMinThreshold")} @@ -23,7 +23,7 @@ export class BallotMinThresholdMetadata extends React.Component {
- + ballotStore.changeBallotMetadata(e, "endTime")} diff --git a/src/components/BallotProxyCard.jsx b/src/components/BallotProxyCard.jsx index 2cea2ee..b1b640f 100644 --- a/src/components/BallotProxyCard.jsx +++ b/src/components/BallotProxyCard.jsx @@ -1,6 +1,6 @@ import React from 'react'; import moment from 'moment'; -import { observable, action, computed } from "mobx"; +import { observable, action } from "mobx"; import { inject, observer } from "mobx-react"; import { toAscii } from "../helpers"; import { constants } from "../constants"; @@ -198,7 +198,7 @@ export class BallotProxyCard extends React.Component { const { commonStore, contractsStore, ballotStore } = this.props; let ballotClass = (commonStore.filtered && this.isFinalized) ? "ballots-i display-none" : "ballots-i"; return ( -
+
diff --git a/src/components/BallotProxyMetadata.jsx b/src/components/BallotProxyMetadata.jsx index 4745c8f..09224e6 100644 --- a/src/components/BallotProxyMetadata.jsx +++ b/src/components/BallotProxyMetadata.jsx @@ -12,7 +12,7 @@ export class BallotProxyMetadata extends React.Component {
- + ballotStore.changeBallotMetadata(e, "proposedAddress", "ballotProxy")} @@ -24,7 +24,7 @@ export class BallotProxyMetadata extends React.Component {
- + ballotStore.changeBallotMetadata(e, "endTime")} diff --git a/src/components/Ballots.jsx b/src/components/Ballots.jsx index 6868e57..9c6a8ce 100644 --- a/src/components/Ballots.jsx +++ b/src/components/Ballots.jsx @@ -5,10 +5,6 @@ import "babel-polyfill"; @inject("commonStore", "contractsStore", "ballotStore", "ballotsStore") @observer export class Ballots extends React.Component { - constructor(props) { - super(props); - } - render () { const { commonStore, ballotsStore } = this.props; if (ballotsStore.ballotCards.length > 0) { diff --git a/src/components/KeysTypes.jsx b/src/components/KeysTypes.jsx index 3e92ec2..a7cc20b 100644 --- a/src/components/KeysTypes.jsx +++ b/src/components/KeysTypes.jsx @@ -15,7 +15,7 @@ export class KeysTypes extends React.Component { checked={ballotStore.isAddKeysBallotType} onChange={e => ballotStore.changeKeysBallotType(e, ballotStore.KeysBallotType.add)} /> - +

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod

@@ -26,7 +26,7 @@ export class KeysTypes extends React.Component { checked={ballotStore.isRemoveKeysBallotType} onChange={e => ballotStore.changeKeysBallotType(e, ballotStore.KeysBallotType.remove)} /> - +

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod

@@ -37,7 +37,7 @@ export class KeysTypes extends React.Component { checked={ballotStore.isSwapKeysBallotType} onChange={e => ballotStore.changeKeysBallotType(e, ballotStore.KeysBallotType.swap)} /> - +

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod

@@ -50,7 +50,7 @@ export class KeysTypes extends React.Component { checked={ballotStore.isMiningKeyType} onChange={e => ballotStore.changeKeyType(e, ballotStore.KeyType.mining)} /> - +

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod

@@ -61,7 +61,7 @@ export class KeysTypes extends React.Component { checked={ballotStore.isPayoutKeyType} onChange={e => ballotStore.changeKeyType(e, ballotStore.KeyType.payout)} /> - +

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod

@@ -72,7 +72,7 @@ export class KeysTypes extends React.Component { checked={ballotStore.isVotingKeyType} onChange={e => ballotStore.changeKeyType(e, ballotStore.KeyType.voting)} /> - +

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod

diff --git a/src/components/NewBallot.jsx b/src/components/NewBallot.jsx index b18c9fe..88a0674 100644 --- a/src/components/NewBallot.jsx +++ b/src/components/NewBallot.jsx @@ -143,7 +143,7 @@ export class NewBallot extends React.Component { onClick = async () => { const { commonStore, contractsStore, ballotStore } = this.props; - const { location, push, goBack } = this.props.routing; + const { push } = this.props.routing; commonStore.showLoading(); const isValidVotingKey = contractsStore.isValidVotingKey; if (!isValidVotingKey) { @@ -213,7 +213,7 @@ export class NewBallot extends React.Component { checked={ballotStore.isBallotForKey} onChange={e => ballotStore.changeBallotType(e, ballotStore.BallotType.keys)} /> - +

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore @@ -227,7 +227,7 @@ export class NewBallot extends React.Component { checked={ballotStore.isBallotForMinThreshold} onChange={e => ballotStore.changeBallotType(e, ballotStore.BallotType.minThreshold)} /> - +

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore @@ -241,7 +241,7 @@ export class NewBallot extends React.Component { checked={ballotStore.isBallotForProxy} onChange={e => ballotStore.changeBallotType(e, ballotStore.BallotType.proxy)} /> - +

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore diff --git a/src/components/Validator.jsx b/src/components/Validator.jsx index de54c04..0728f7c 100644 --- a/src/components/Validator.jsx +++ b/src/components/Validator.jsx @@ -12,7 +12,7 @@ export class Validator extends React.Component {

- + validatorStore.changeValidatorMetadata(e, "fullName")} @@ -24,7 +24,7 @@ export class Validator extends React.Component {
- + validatorStore.changeValidatorMetadata(e, "address")} @@ -36,7 +36,7 @@ export class Validator extends React.Component {
- + validatorStore.changeValidatorMetadata(e, "zipCode")} @@ -114,7 +114,7 @@ export class Validator extends React.Component {
- + validatorStore.changeValidatorMetadata(e, "licenseID")} @@ -126,7 +126,7 @@ export class Validator extends React.Component {
- + validatorStore.changeValidatorMetadata(e, "licenseExpiration")} diff --git a/src/stores/BallotsStore.js b/src/stores/BallotsStore.js index b94f950..9f35517 100644 --- a/src/stores/BallotsStore.js +++ b/src/stores/BallotsStore.js @@ -1,4 +1,4 @@ -import { observable, computed, action } from 'mobx'; +import { observable } from 'mobx'; class BallotsStore { @observable activeKeysBallotsLength; diff --git a/src/stores/CommonStore.js b/src/stores/CommonStore.js index 812d005..816959f 100644 --- a/src/stores/CommonStore.js +++ b/src/stores/CommonStore.js @@ -1,9 +1,10 @@ -import { observable, computed, action } from 'mobx'; +import { observable, action } from 'mobx'; class CommonStore { @observable loading; @observable rootPath; @observable filtered; + @observable searchTerm; constructor() { this.loading = false; @@ -20,6 +21,11 @@ class CommonStore { hideLoading() { this.loading = false; } + + @action("set search term") + setSearchTerm = (_val) => { + this.searchTerm = _val; + } } const commonStore = new CommonStore(); diff --git a/src/stores/ValidatorStore.js b/src/stores/ValidatorStore.js index 215319b..f4acfa1 100644 --- a/src/stores/ValidatorStore.js +++ b/src/stores/ValidatorStore.js @@ -1,4 +1,4 @@ -import { observable, computed, action } from 'mobx'; +import { observable, action } from 'mobx'; class ValidatorStore {