Skip to content

Commit ebff195

Browse files
committed
Add welcome page
1 parent 64882b8 commit ebff195

File tree

5 files changed

+61
-7
lines changed

5 files changed

+61
-7
lines changed

tools/docs/www/src/app.jsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import React, { Component, Fragment } from 'react';
2222
import { Route, Switch, withRouter } from 'react-router-dom';
2323
import { Link } from 'react-router-dom';
2424
import SideMenu from './side_menu.jsx';
25+
import WelcomePage from './welcome_page.jsx';
2526
import VERSIONS from './versions.json';
2627
import './css/app.css';
2728
import './css/reset.css';
@@ -54,7 +55,7 @@ class App extends Component {
5455
super( props );
5556

5657
this.state = {
57-
slideoutIsOpen: false,
58+
slideoutIsOpen: true,
5859
version: VERSIONS[ 0 ],
5960
packageTree: null,
6061
packageResources: {}
@@ -89,7 +90,7 @@ class App extends Component {
8990
<nav className="navbar">
9091
{ hasBenchmarks ? <Link to={`/${match.params.version}/docs/api/@stdlib/${match.params.pkg}/benchmark.html`}>Benchmarks</Link> : null}
9192
{ hasTests ? <Link to={`/${match.params.version}/docs/api/@stdlib/${match.params.pkg}/test.html`}>Tests</Link> : null}
92-
<a href={`https://github.com/stdlib-js/stdlib/tree/${match.params.version}/lib/node_modules/@stdlib/${match.params.pkg}`}>Source</a>
93+
{ resources ? <a href={`https://github.com/stdlib-js/stdlib/tree/${match.params.version}/lib/node_modules/@stdlib/${match.params.pkg}`}>Source</a> : null}
9394
</nav>
9495
<ReadmePage path={match.url} />
9596
</Fragment>
@@ -187,7 +188,7 @@ class App extends Component {
187188
<nav className="navbar">
188189
{ hasBenchmarks ? <Link to={`/${match.params.version}/docs/api/@stdlib/${match.params.pkg}/benchmark.html`}>Benchmarks</Link> : null}
189190
{ hasTests ? <Link to={`/${match.params.version}/docs/api/@stdlib/${match.params.pkg}/test.html`}>Tests</Link> : null}
190-
<a href={`https://github.com/stdlib-js/stdlib/tree/${match.params.version}/lib/node_modules/@stdlib/${match.params.pkg}`}>Source</a>
191+
{ resources ? <a href={`https://github.com/stdlib-js/stdlib/tree/${match.params.version}/lib/node_modules/@stdlib/${match.params.pkg}`}>Source</a> : null}
191192
</nav>
192193
{iframe}
193194
</Fragment>
@@ -212,7 +213,7 @@ class App extends Component {
212213
<nav className="navbar">
213214
{ hasBenchmarks ? <Link to={`/${match.params.version}/docs/api/@stdlib/${match.params.pkg}/benchmark.html`}>Benchmarks</Link> : null}
214215
{ hasTests ? <Link to={`/${match.params.version}/docs/api/@stdlib/${match.params.pkg}/test.html`}>Tests</Link> : null}
215-
<a href={`https://github.com/stdlib-js/stdlib/tree/${match.params.version}/lib/node_modules/@stdlib/${match.params.pkg}`}>Source</a>
216+
{ resources ? <a href={`https://github.com/stdlib-js/stdlib/tree/${match.params.version}/lib/node_modules/@stdlib/${match.params.pkg}`}>Source</a> : null}
216217
</nav>
217218
{iframe}
218219
</Fragment>
@@ -229,6 +230,9 @@ class App extends Component {
229230
path="/:version/docs/api/@stdlib/:pkg*"
230231
render={this.renderReadme}
231232
/>
233+
<Route exact path="/" >
234+
<WelcomePage />
235+
</Route>
232236
</Switch>
233237
</div>
234238
</div>

tools/docs/www/src/css/app.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,28 @@ body {
3131
left: 20px;
3232
}
3333

34+
#stdlib-logo {
35+
opacity: 0.9;
36+
}
37+
38+
#stdlib-logo:hover{
39+
opacity: 1;
40+
}
41+
3442
#menu-close-icon {
3543
color:#c7c7c7;
3644
}
3745

3846
#menu-close-icon:hover {
3947
color: #bfc4c9;
48+
box-shadow: 20px;
4049
}
4150

4251
.side-menu-head {
4352
display: flex;
4453
align-items: center;
45-
justify-content: center;
54+
justify-content: space-between;
55+
padding-left: 10px;
4656
}
4757

4858
.side-menu-drawer {

tools/docs/www/src/logo.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import React from 'react';
2323

2424
// MAIN //
2525

26-
const svg = () => <svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="110.25" height="35" viewBox="0, 0, 315, 100">
26+
const svg = () => <svg id="stdlib-logo" version="1.1" xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="110.25" height="35" viewBox="0, 0, 315, 100">
2727
<defs>
2828
<linearGradient id="Gradient_1" gradientUnits="userSpaceOnUse" x1="26.041" y1="25.718" x2="49.937" y2="11.918">
2929
<stop offset="0" stopColor="#A4681D"></stop>

tools/docs/www/src/side_menu.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import React, { Component, Fragment } from 'react';
2222
import { debounce } from 'throttle-debounce';
23+
import { Link } from 'react-router-dom';
2324
import List from '@material-ui/core/List';
2425
import ListItem from '@material-ui/core/ListItem';
2526
import Collapse from '@material-ui/core/Collapse';
@@ -231,7 +232,9 @@ class MenuBar extends Component {
231232
}}
232233
>
233234
<div className="side-menu-head" >
234-
<Logo />
235+
<Link to="/">
236+
<Logo />
237+
</Link>
235238
<IconButton aria-label="close drawer" onClick={this.handleDrawerClose} edge="start" >
236239
<ChevronRightIcon id="menu-close-icon" />
237240
</IconButton>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2019 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
// MODULES //
20+
21+
import React from 'react';
22+
23+
24+
// MAIN //
25+
26+
const WelcomePage = () => {
27+
return (
28+
<div className="readme" >
29+
<h2><code>stdlib</code> project documentation</h2>
30+
</div>
31+
);
32+
};
33+
34+
35+
// EXPORTS //
36+
37+
export default WelcomePage;

0 commit comments

Comments
 (0)