summaryrefslogtreecommitdiffstats
path: root/web/react/components/settings_sidebar.jsx
blob: b4d291622a47ffe3a2ae81519c268f8d622923af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
// See License.txt for license information.

var utils = require('../utils/utils.jsx');

module.exports = React.createClass({
    displayName:'SettingsSidebar',
    updateTab: function(tab) {
        this.props.updateTab(tab);
        $('.settings-modal').addClass('display--content');
    },
    render: function() {
        var self = this;
        return (
            <div className="">
                <ul className="nav nav-pills nav-stacked">
                    {this.props.tabs.map(function(tab) {
                        return <li key={tab.name+'_li'} className={self.props.activeTab == tab.name ? 'active' : ''}><a key={tab.name + '_a'} href="#" onClick={function(){self.updateTab(tab.name);}}><i key={tab.name+'_i'} className={tab.icon}></i>{tab.ui_name}</a></li>
                    })}
                </ul>
            </div>
        );
    }
});