Skip to content

Commit cc683ed

Browse files
committed
Update components/SidebarMobile.jsx
1 parent 2bf7ada commit cc683ed

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/components/SidebarMobile/SidebarMobile.jsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ let initialTouchPosition = {};
55
let lastTouchPosition = {};
66

77
export default class SidebarMobile extends React.Component {
8+
constructor(props) {
9+
super(props);
10+
11+
this._handleBodyClick = this._handleBodyClick.bind(this);
12+
}
13+
814
render() {
915
return (
1016
<nav
@@ -59,7 +65,7 @@ export default class SidebarMobile extends React.Component {
5965

6066
return this.props.sections.map(section => {
6167
let active = pathname === section.url || pathname.includes(`/${section.url}`),
62-
absoluteUrl = `/${section.url}`;
68+
absoluteUrl = (section.url == '/') ? '/' : `/${section.url}`;
6369

6470
return (
6571
<div
@@ -70,7 +76,7 @@ export default class SidebarMobile extends React.Component {
7076
key={ absoluteUrl }
7177
to={ absoluteUrl }
7278
onClick={ this._close.bind(this) }>
73-
<h3>{ section.title }</h3>
79+
<h3>{ section.title || section.url }</h3>
7480
</Link>
7581

7682
{ this._getPages(section.pages) }
@@ -93,7 +99,7 @@ export default class SidebarMobile extends React.Component {
9399
}
94100

95101
return pages.map(page => {
96-
let url = `/${page.url}`,
102+
let url = `${page.url}`,
97103
active = pathname === url || pathname.includes(`${url}/`);
98104

99105
return (

0 commit comments

Comments
 (0)