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 from 'react';
|
|
|
|
import Link from 'gatsby-link';
|
|
|
|
import Page from '../../components/Page';
|
|
|
|
import Padded from '../../components/Padded';
|
|
|
|
import {Row, Col} from 'antd';
|
2018-02-13 03:50:33 -08:00
|
|
|
import './index.css';
|
2018-02-12 09:28:31 -08:00
|
|
|
|
2018-02-12 10:25:02 -08:00
|
|
|
const CATEGORY_TITLE = {
|
|
|
|
'getting-started': 'Getting Started',
|
2018-02-15 06:12:23 -08:00
|
|
|
properties: 'Properties',
|
|
|
|
examples: 'Examples',
|
|
|
|
contributing: 'Contributing',
|
2018-02-12 10:25:02 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
export default ({data}) => (
|
2018-02-19 02:08:18 -08:00
|
|
|
<Page className="docs-landing" shouldShowFooter title="Documentation">
|
2018-02-12 09:28:31 -08:00
|
|
|
<Padded>
|
2018-02-13 03:50:33 -08:00
|
|
|
<Row className="heading">
|
|
|
|
<Col xl={16} lg={16} md={24} sm={24} xs={24}>
|
|
|
|
<h1>Documentation</h1>
|
|
|
|
<p>
|
2018-02-15 06:12:23 -08:00
|
|
|
Welcome to Yoga's documentation page. Below you will find helpful
|
2018-02-16 06:42:04 -08:00
|
|
|
documentation covering all the features of the library. Each page
|
2018-02-19 02:08:18 -08:00
|
|
|
comes with an interactive playground for you to explore that
|
2018-02-21 09:07:29 -08:00
|
|
|
feature. The examples section showcases some of the most common
|
2018-02-19 02:08:18 -08:00
|
|
|
layouts and how to build them. This is a community projects and
|
|
|
|
contributions within documentation, code, and tests are more then
|
|
|
|
welcome. The contributing section below covers how to get started.
|
2018-02-13 03:50:33 -08:00
|
|
|
</p>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
2018-02-12 09:28:31 -08:00
|
|
|
<Row>
|
2018-02-12 10:25:02 -08:00
|
|
|
{['getting-started', 'properties', 'examples', 'contributing'].map(
|
|
|
|
category => (
|
2018-02-13 03:50:33 -08:00
|
|
|
<Col lg={6} md={12} xs={24} key={category} className="category">
|
2018-02-12 10:25:02 -08:00
|
|
|
<h2>{CATEGORY_TITLE[category]}</h2>
|
|
|
|
{data.allMarkdownRemark.edges
|
|
|
|
.filter(
|
|
|
|
({node}) =>
|
|
|
|
node.fileAbsolutePath.indexOf(`/${category}/`) > -1,
|
|
|
|
)
|
2018-02-15 06:12:23 -08:00
|
|
|
.map(
|
|
|
|
({node}) =>
|
|
|
|
node.frontmatter.redirect ? (
|
|
|
|
<a key={node.id} href={node.frontmatter.path}>
|
2018-02-13 06:37:47 -08:00
|
|
|
{node.frontmatter.title}
|
2018-02-15 06:12:23 -08:00
|
|
|
</a>
|
|
|
|
) : (
|
|
|
|
<Link key={node.id} to={node.frontmatter.path}>
|
2018-02-13 06:37:47 -08:00
|
|
|
{node.frontmatter.title}
|
2018-02-15 06:12:23 -08:00
|
|
|
</Link>
|
|
|
|
),
|
|
|
|
)}
|
2018-02-12 10:25:02 -08:00
|
|
|
</Col>
|
|
|
|
),
|
|
|
|
)}
|
2018-02-12 09:28:31 -08:00
|
|
|
</Row>
|
|
|
|
</Padded>
|
|
|
|
</Page>
|
|
|
|
);
|
2018-02-12 10:25:02 -08:00
|
|
|
|
|
|
|
export const query = graphql`
|
|
|
|
query IndexQuery {
|
|
|
|
allMarkdownRemark {
|
|
|
|
edges {
|
|
|
|
node {
|
|
|
|
id
|
|
|
|
frontmatter {
|
|
|
|
title
|
|
|
|
path
|
2018-02-14 08:42:49 -08:00
|
|
|
redirect
|
2018-02-12 10:25:02 -08:00
|
|
|
}
|
|
|
|
fileAbsolutePath
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|