2018-02-12 09:28:31 -08:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*
|
|
|
|
* @flow
|
|
|
|
* @format
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import Page from '../components/Page';
|
|
|
|
import Playground from '../components/Playground';
|
|
|
|
import DocsSidebar from '../components/DocsSidebar';
|
2018-02-12 10:25:02 -08:00
|
|
|
import EditValue from '../components/Playground/EditValue';
|
|
|
|
import Link from 'gatsby-link';
|
|
|
|
import {Button, Icon, Row, Col} from 'antd';
|
2018-02-13 03:50:40 -08:00
|
|
|
import './index.css';
|
2018-02-12 09:28:31 -08:00
|
|
|
|
2018-02-12 10:25:02 -08:00
|
|
|
export default ({pathContext}) => (
|
2018-02-13 06:37:44 -08:00
|
|
|
<Page className="doc-block playground">
|
2018-02-12 10:25:02 -08:00
|
|
|
<Playground
|
|
|
|
selectedNodePath={[]}
|
|
|
|
showGuides={false}
|
|
|
|
renderSidebar={(layout, onChange) => (
|
|
|
|
<DocsSidebar>
|
2018-02-13 03:50:40 -08:00
|
|
|
<div className="markdown" dangerouslySetInnerHTML={{__html: pathContext.html}} />
|
|
|
|
|
2018-02-12 10:25:02 -08:00
|
|
|
{(pathContext.frontmatter.editableProperties || []).map(prop => (
|
2018-02-13 03:50:40 -08:00
|
|
|
<div key={prop} className="prop">
|
2018-02-12 10:25:02 -08:00
|
|
|
<h4>{prop}</h4>
|
|
|
|
<EditValue
|
|
|
|
property={prop}
|
|
|
|
value={layout[prop]}
|
2018-02-13 06:13:29 -08:00
|
|
|
onChange={onChange}
|
2018-02-12 10:25:02 -08:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
))}
|
2018-02-13 03:50:40 -08:00
|
|
|
|
|
|
|
<Link to="/docs" className="overview">
|
|
|
|
BACK TO OVERVIEW
|
|
|
|
</Link>
|
2018-02-12 10:25:02 -08:00
|
|
|
</DocsSidebar>
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
</Page>
|
|
|
|
);
|