2018-02-12 09:28:31 -08:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2018-02-12 09:28:31 -08:00
|
|
|
*
|
|
|
|
* @flow
|
|
|
|
* @format
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
|
import Link from 'gatsby-link';
|
2018-02-14 08:42:49 -08:00
|
|
|
import {Icon, Row, Col} from 'antd';
|
2018-02-16 07:19:58 -08:00
|
|
|
import logo from '../pages/logos/logo.svg';
|
2018-02-12 09:28:31 -08:00
|
|
|
import './Toolbar.css';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
onShowCode?: () => void,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default class Toolbar extends Component<Props> {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className="Toolbar">
|
|
|
|
<Link to="/" className="logo">
|
2018-02-16 07:19:58 -08:00
|
|
|
<img src={logo} width="42" alt="Yoga logo" />
|
|
|
|
</Link>
|
|
|
|
|
|
|
|
<Link to="/docs" activeClassName="selected">
|
|
|
|
Documentation
|
2018-02-12 09:28:31 -08:00
|
|
|
</Link>
|
2018-02-14 08:42:49 -08:00
|
|
|
|
|
|
|
<Row>
|
2018-02-16 06:41:58 -08:00
|
|
|
<Col lg={24} md={0} sm={0} xs={0}>
|
2018-02-16 07:19:58 -08:00
|
|
|
<Link to="/playground" activeClassName="selected">
|
|
|
|
Playground
|
|
|
|
</Link>
|
2018-02-14 08:42:49 -08:00
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
|
2018-02-12 09:28:31 -08:00
|
|
|
<a href="https://github.com/facebook/yoga">GitHub</a>
|
2018-02-12 10:27:12 -08:00
|
|
|
|
2018-02-12 09:28:31 -08:00
|
|
|
{this.props.onShowCode && (
|
|
|
|
<a className="ToolbarToggle" onClick={this.props.onShowCode}>
|
|
|
|
<Icon type={'code-o'} />
|
|
|
|
Code
|
|
|
|
</a>
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|