graphene/docs/pages/_template.js

52 lines
1.8 KiB
JavaScript
Raw Normal View History

2015-11-21 21:33:29 +03:00
import React from 'react';
import { RouteHandler, Link, State } from 'react-router';
import Icon from 'assets/icon'
2015-11-26 13:30:52 +03:00
import {stack as Menu} from 'react-burger-menu';
2015-11-21 21:33:29 +03:00
import Header from './_header'
import logo from '!raw!assets/logo.svg'
import styles from '../css/main.styl'
class Template extends React.Component {
render() {
var path = this.props.page.path;
var isIndex = path == '/';
return (
<div>
2015-11-26 13:30:52 +03:00
<Menu width={200} right>
2015-11-27 10:50:37 +03:00
<span><Link to="/playground/">Try it out</Link></span>
2015-11-26 13:30:52 +03:00
<span><Link to="/docs/quickstart/" className={path.indexOf('/docs')==0?"active":null}>Docs</Link></span>
<span><Link to="/community/">Community</Link></span>
<a href="https://github.com/graphql-python/graphene/">Github</a>
</Menu>
2015-11-21 21:33:29 +03:00
<header className="header">
<div className="header-wrapper">
<Link className="header-logo" to="/">
<Icon src={logo} />
Graphene
</Link>
<nav className="header-nav">
2015-11-27 10:50:37 +03:00
<Link to="/playground/">Try it out</Link>
2015-11-26 02:25:03 +03:00
<Link to="/docs/quickstart/" className={path.indexOf('/docs')==0?"active":null}>Docs</Link>
2015-11-21 21:33:29 +03:00
<Link to="/community/">Community</Link>
2015-11-26 02:25:03 +03:00
<a href="https://github.com/graphql-python/graphene/">Github</a>
2015-11-21 21:33:29 +03:00
</nav>
</div>
{isIndex?
<div className="header-extended">
<h1>
GraphQL in Python<br />
made <strong>simple</strong>
</h1>
<Link to="/docs/quickstart/" className="get-started">Get Started</Link>
<Header />
</div>:null}
</header>
<RouteHandler {...this.props}/>
</div>
);
}
}
module.exports = Template;