var React = require('react'); var connect = require('react-redux').connect; var actions = require('../../store/actions'); var TreeItem = require('./tree-item.jsx'); 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({ componentDidMount: function() { this.props.dispatch(actions.launcher.loadProfile('./default-profile.json')); }, 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)); } }); function select(state) { return { profile: state.profile, theme: state.theme }; } module.exports = connect(select)(ProfileTree);