diff --git a/example/preferences.js b/example/preferences.js index 851e142..0e5d4c7 100644 --- a/example/preferences.js +++ b/example/preferences.js @@ -19,7 +19,7 @@ const preferences = new ElectronPreferences({ }, // ... }, - debug: false, //true will open the dev tools + debug: true, //true will open the dev tools webPreferences: { webSecurity: true }, diff --git a/src/app/components/sidebar/index.jsx b/src/app/components/sidebar/index.jsx index ed7cd2e..8993233 100644 --- a/src/app/components/sidebar/index.jsx +++ b/src/app/components/sidebar/index.jsx @@ -8,8 +8,9 @@ class Sidebar extends React.Component { render() { const sections = this.sections.map((section) => { + const isActive = this.activeSection === section.id; let className = 'sidebar-section'; - if (this.activeSection === section.id) { + if (isActive) { className += ' active'; } @@ -18,17 +19,19 @@ class Sidebar extends React.Component { webkitMask: `url("svg/${section.icon}.svg") no-repeat center / contain` } return ( -
+ ); }); return ( -
+
+ ); } @@ -99,6 +102,8 @@ Sidebar.propTypes = { sections: PropTypes.array, activeSection: PropTypes.string, onSelectSection: PropTypes.func, + selectSection: PropTypes.func, + onTablistKeyDown: PropTypes.func }; export default Sidebar;