Skip to content

Commit

Permalink
css modules react-component#3
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniogiordano committed Jan 24, 2017
1 parent e0505a5 commit f6eed74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/MenuItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { PropTypes } from 'react';
import KeyCode from 'rc-util/lib/KeyCode';
import classnames from 'classnames';
import { noop } from './util';
import css from '../assets/index.css';

/* eslint react/no-is-mounted:0 */

Expand Down Expand Up @@ -152,10 +153,10 @@ const MenuItem = React.createClass({
const props = this.props;
const selected = this.isSelected();
const classes = {};
classes[this.getActiveClassName()] = !props.disabled && props.active;
classes[this.getSelectedClassName()] = selected;
classes[this.getDisabledClassName()] = props.disabled;
classes[this.getPrefixCls()] = true;
classes[css[this.getActiveClassName()]] = !props.disabled && props.active;
classes[css[this.getSelectedClassName()]] = selected;
classes[css[this.getDisabledClassName()]] = props.disabled;
classes[css[this.getPrefixCls()]] = true;
classes[props.className] = !!props.className;
const attrs = {
...props.attribute,
Expand Down
5 changes: 3 additions & 2 deletions src/SubMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { PropTypes } from 'react';
import KeyCode from 'rc-util/lib/KeyCode';
import classnames from 'classnames';
import { noop, loopMenuItemRecusively } from './util';
import css from '../assets/index.css';

let guid = 0;

Expand Down Expand Up @@ -390,8 +391,8 @@ const SubMenu = React.createClass({
}
}

classes[prefixCls] = true;
classes[`${prefixCls}-${props.mode}`] = 1;
classes[css[prefixCls]] = true;
classes[css[`${prefixCls}-${props.mode}`]] = 1;
let titleClickEvents = {};
let mouseEvents = {};
let titleMouseEvents = {};
Expand Down

0 comments on commit f6eed74

Please sign in to comment.