Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Use disableMenu.css to disable menu when votedDelegates is empty as I…
Browse files Browse the repository at this point in the history
…conMenu theme
  • Loading branch information
yasharAyari committed Aug 25, 2017
1 parent 07182be commit e317d32
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/voting/votingHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Button } from 'react-toolbox/lib/button';
import { IconMenu, MenuItem } from 'react-toolbox/lib/menu';
import Input from 'react-toolbox/lib/input';
import styles from './voting.css';
import disableStyle from './disableMenu.css';
import Confirm from './confirmVotes';

class VotingHeader extends React.Component {
Expand Down Expand Up @@ -49,11 +50,12 @@ class VotingHeader extends React.Component {
}

render() {
const className = this.props.votedDelegates.length === 0 ? 'disable' : '';
const theme = this.props.votedDelegates.length === 0 ? disableStyle : styles;
const button = <div className={styles.votesMenuButton}>
<i className={`material-icons ${className}`}>visibility</i>
<span className={className}>my votes ({this.props.votedDelegates.length})</span>
<i className='material-icons'>visibility</i>
<span>my votes ({this.props.votedDelegates.length})</span>
</div>;
console.log(theme);
return (
<header className={`${grid.row} ${grid['between-xs']} hasPaddingRow`}>
<div className={`${grid['col-xs-3']} ${styles.searchBox}`}>
Expand All @@ -68,7 +70,7 @@ class VotingHeader extends React.Component {
</i>
</div>
<div className={styles.actionBar}>
<IconMenu theme={styles} icon={button} position='topLeft'
<IconMenu theme={theme} icon={button} position='topLeft'
iconRipple={false} className='my-votes-button'>
{this.props.votedDelegates.map(delegate =>
<MenuItem
Expand Down

0 comments on commit e317d32

Please sign in to comment.