Browse Source

Run check-all script

main
jxom 7 years ago
parent
commit
15fc32561f
  1. 7
      src/templates/components/Sidebar/ScrollSyncSection.js
  2. 8
      src/templates/components/Sidebar/Section.js
  3. 8
      src/templates/components/Sidebar/Sidebar.js

7
src/templates/components/Sidebar/ScrollSyncSection.js

@ -71,12 +71,7 @@ class ScrollSyncSection extends Component {
render() {
const {activeItemId} = this.state;
return (
<Section
isScrollSync
activeItemId={activeItemId} {...this.props}
/>
);
return <Section isScrollSync activeItemId={activeItemId} {...this.props} />;
}
}

8
src/templates/components/Sidebar/Section.js

@ -66,7 +66,9 @@ const Section = ({
marginTop: 5,
}}>
{createLink({
isActive: isScrollSync ? activeItemId === item.id : isItemActive(location, item),
isActive: isScrollSync
? activeItemId === item.id
: isItemActive(location, item),
item,
location,
onLinkClick,
@ -78,7 +80,9 @@ const Section = ({
{item.subitems.map(subitem => (
<li key={subitem.id}>
{createLink({
isActive: isScrollSync ? activeItemId === subitem.id : isItemActive(location, subitem),
isActive: isScrollSync
? activeItemId === subitem.id
: isItemActive(location, subitem),
item: subitem,
location,
onLinkClick,

8
src/templates/components/Sidebar/Sidebar.js

@ -25,7 +25,13 @@ class Sidebar extends Component {
}
render() {
const {closeParentMenu, createLink, enableScrollSync, location, sectionList} = this.props;
const {
closeParentMenu,
createLink,
enableScrollSync,
location,
sectionList,
} = this.props;
const {activeSection} = this.state;
const SectionComponent = enableScrollSync ? ScrollSyncSection : Section;

Loading…
Cancel
Save