Skip to content

Commit 6df60ef

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

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

tools/docs/www/src/app.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class App extends Component {
5555
super( props );
5656

5757
this.state = {
58-
slideoutIsOpen: true,
58+
slideoutIsOpen: false,
5959
version: VERSIONS[ 0 ],
6060
packageTree: null,
6161
packageResources: {}

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
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const WelcomePage = () => {
2727
return (
2828
<Fragment>
2929
<nav className="navbar">
30-
<a href="https://stdlib.io/">Go to project website</a>
30+
<a href="https://stdlib.io/">stdlib.io</a>
3131
</nav>
3232
<div className="readme" >
3333
<h2><code>stdlib</code> project documentation</h2>

0 commit comments

Comments
 (0)