flexWrap, alignContent, initialPlayground

Summary: Adds `initialPlayground` to the markdown header. Adds contents fro alignContent and flexWrap.

Reviewed By: emilsjolander

Differential Revision: D6987513

fbshipit-source-id: 41de309d427a9f42e09477170fb8512ce1e7a816
This commit is contained in:
Daniel Büchele
2018-02-14 07:53:08 -08:00
committed by Facebook Github Bot
parent 8c5cbf698b
commit 740ef6cd9e
6 changed files with 45 additions and 18 deletions

View File

@@ -22,16 +22,25 @@ import './index.css';
type Props = {
pathContext: {
html: string,
frontmatter: {},
frontmatter: {
initialPlayground?: string,
},
},
};
const REGEX = /<controls prop="([A-Za-z]+)"\s?\/>/gi;
export default class withPlayground extends Component<Props> {
render() {
let layoutDefinition;
if (this.props.pathContext.frontmatter.initialPlayground) {
layoutDefinition = JSON.parse(
atob(this.props.pathContext.frontmatter.initialPlayground),
);
}
return (
<Page className="doc-block playground">
<Playground
layoutDefinition={layoutDefinition}
selectedNodePath={[]}
showGuides={false}
renderSidebar={(layout, onChange) => (