var React = require('react'); var connect = require('react-redux').connect; var actions = require('../../store/actions'); var TreeItem = require('./tree-item.js'); var TreeNode = React.createClass({ render: function() { var data = this.props.data || {}; var subItems = data.items || []; var listElements = subItems.map(function(subItem, i) { return (
  • ); }.bind(this)); var appEntry = data.icon || data.label ? this.renderTreeItem(data): null ; return (
    {appEntry}
    ); }, renderTreeItem: function(data) { return ( ); } }); var ProfileTree = React.createClass({ render: function() { return (
    {this.renderTreeNode(this.props.profile)}
    ); }, renderTreeNode: function(data) { return ( ); }, onItemMoved: function(movedItem, targetItem) { this.props.dispatch(actions.edit.moveProfileItem(movedItem, targetItem)); }, onItemSelected: function(selectedItem) { this.props.dispatch(actions.edit.selectProfileItem(selectedItem)); }, onItemRemoved: function(selectedItem) { this.props.dispatch(actions.edit.removeProfileItem(selectedItem)); } }); function select(state) { return { profile: state.profile, theme: state.theme }; } module.exports = connect(select)(ProfileTree);