Settings, Slack link and landing page

This commit is contained in:
Jori Lallo
2016-08-23 20:39:31 -07:00
parent 748b3ab66b
commit 29665621b3
12 changed files with 114 additions and 41 deletions

View File

@ -1,17 +1,30 @@
import React from 'react';
import { browserHistory } from 'react-router';
import styles from './DropdownMenu.scss';
const MenuItem = (props) => {
return (
<div
className={ styles.menuItem }
onClick={ props.onClick}
>{ props.children }</div>
);
};
class MenuItem extends React.Component {
onClick = () => {
if (this.props.to) {
browserHistory.push(this.props.to);
} else {
this.props.onClick();
}
}
render() {
return (
<div
className={ styles.menuItem }
onClick={ this.onClick }
>{ this.props.children }</div>
);
}
}
MenuItem.propTypes = {
onClick: React.PropTypes.func,
to: React.PropTypes.string,
children: React.PropTypes.node.isRequired,
};
@ -63,4 +76,4 @@ class DropdownMenu extends React.Component {
export default DropdownMenu;
export {
MenuItem,
}
}