Highlight correctly active package · stdlib-js/stdlib@6df60ef · GitHub
Skip to content

Commit 6df60ef

Browse files
committed
Highlight correctly active package
1 parent b00dd6e commit 6df60ef

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎tools/docs/www/src/app.jsx‎

Lines changed: 1 addition & 1 deletion

‎tools/docs/www/src/side_menu.jsx‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ class MenuBar extends Component {
5858
const active = !prevState[ path ];
5959
return {
6060
[ path ]: active,
61-
activePkg: active ? path.substring( path.lastIndexOf( '/' )+1 ) : null
61+
activePkg: path
6262
}
6363
});
6464
}
6565

66-
handlePackageClick( pkg ) {
66+
handlePackageClick( pkgPath ) {
6767
this.setState({
68-
activePkg: pkg
68+
activePkg: pkgPath
6969
});
7070
}
7171

@@ -90,13 +90,13 @@ class MenuBar extends Component {
9090
key={`${pkgPath}-item`}
9191
className="side-menu-list-item"
9292
onClick={() => {
93-
this.handlePackageClick( pkg );
93+
this.handlePackageClick( pkgPath );
9494
const path = `/${this.props.version}/docs/api/${pkgPath}`;
9595
this.props.onReadmeChange( path );
9696
}}
9797
style={{
9898
paddingLeft: 16 + 10 * level,
99-
color: this.state.activePkg === pkg ? '#5ca2c8' : null
99+
color: this.state.activePkg === pkgPath ? '#5ca2c8' : null
100100
}}
101101
>
102102
{pkg}
@@ -123,7 +123,7 @@ class MenuBar extends Component {
123123
className="side-menu-list-item-namespace"
124124
style={{
125125
paddingLeft: 16 + 10 * level,
126-
color: this.state.activePkg === pkg ? '#5ca2c8' : null
126+
color: this.state.activePkg === pkgPath ? '#5ca2c8' : null
127127
}}
128128
>
129129
{pkg}

‎tools/docs/www/src/welcome_page.jsx‎

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)