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 ? : null ; return (
    {appEntry}
    ); } }); var ProfileTree = React.createClass({ componentDidMount: function() { this.props.dispatch(actions.launcher.loadProfile('./default-profile.json')); }, render: function() { return (
    ); }, onItemMoved: function(movedItem, targetItem) { this.props.dispatch(actions.edit.moveProfileItem(movedItem, targetItem)); } }); function select(state) { return { profile: state.profile }; } module.exports = connect(select)(ProfileTree);