diff --git a/content/home/examples/an-application.js b/content/home/examples/an-application.js index 7b5168618..ec8558767 100644 --- a/content/home/examples/an-application.js +++ b/content/home/examples/an-application.js @@ -13,6 +13,8 @@ class TodoApp extends React.Component {
@@ -56,4 +58,4 @@ class TodoList extends React.Component { } } -ReactDOM.render(, mountNode); \ No newline at end of file +ReactDOM.render(, mountNode); diff --git a/src/templates/components/Sidebar/Section.js b/src/templates/components/Sidebar/Section.js index bf6db263e..2738c8537 100644 --- a/src/templates/components/Sidebar/Section.js +++ b/src/templates/components/Sidebar/Section.js @@ -10,94 +10,104 @@ import isItemActive from 'utils/isItemActive'; import MetaTitle from '../MetaTitle'; import ChevronSvg from '../ChevronSvg'; -const Section = ({ - activeItemId, - createLink, - isActive, - isScrollSync, - location, - onLinkClick, - onSectionTitleClick, - section, -}) => ( -
- -
    - {section.items.map(item => ( -
  • +
- )} - - ))} - -
-); + ':hover': { + color: colors.text, + }, + }, + }}> + {section.title} + + + +
    + {section.items.map(item => ( +
  • + {createLink({ + isActive: isScrollSync + ? activeItemId === item.id + : isItemActive(location, item), + item, + location, + onLinkClick, + section, + })} + + {item.subitems && ( +
      + {item.subitems.map(subitem => ( +
    • + {createLink({ + isActive: isScrollSync + ? activeItemId === subitem.id + : isItemActive(location, subitem), + item: subitem, + location, + onLinkClick, + section, + })} +
    • + ))} +
    + )} +
  • + ))} +
+ + ); + } +} export default Section;