Skip to content

Commit 3612a2a

Browse files
committed
create versions
1 parent 41bb39e commit 3612a2a

File tree

4 files changed

+1497
-0
lines changed

4 files changed

+1497
-0
lines changed

website/pages/en/versions.js

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/**
2+
* Copyright (c) 2017-present, Facebook, Inc.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
const React = require('react');
9+
10+
const CompLibrary = require('../../core/CompLibrary');
11+
12+
const Container = CompLibrary.Container;
13+
14+
const CWD = process.cwd();
15+
16+
const versions = require(`${CWD}/versions.json`);
17+
18+
function Versions(props) {
19+
const {config: siteConfig} = props;
20+
const latestVersion = versions[0];
21+
const repoUrl = `https://github.com/${siteConfig.organizationName}/${
22+
siteConfig.projectName
23+
}`;
24+
return (
25+
<div className="docMainWrapper wrapper">
26+
<Container className="mainContainer versionsContainer">
27+
<div className="post">
28+
<header className="postHeader">
29+
<h1>{siteConfig.title} Versions</h1>
30+
</header>
31+
<h3 id="latest">Current version (Stable)</h3>
32+
<table className="versions">
33+
<tbody>
34+
<tr>
35+
<th>{latestVersion}</th>
36+
<td>
37+
<a href="">Documentation</a>
38+
</td>
39+
<td>
40+
<a href="">Release Notes</a>
41+
</td>
42+
</tr>
43+
</tbody>
44+
</table>
45+
<p>
46+
This is the version that is configured automatically when you first
47+
install this project.
48+
</p>
49+
<h3 id="rc">Pre-release versions</h3>
50+
<table className="versions">
51+
<tbody>
52+
<tr>
53+
<th>master</th>
54+
<td>
55+
<a href="">Documentation</a>
56+
</td>
57+
<td>
58+
<a href="">Release Notes</a>
59+
</td>
60+
</tr>
61+
</tbody>
62+
</table>
63+
<h3 id="archive">Past Versions</h3>
64+
<table className="versions">
65+
<tbody>
66+
{versions.map(
67+
version =>
68+
version !== latestVersion && (
69+
<tr>
70+
<th>{version}</th>
71+
<td>
72+
<a href="">Documentation</a>
73+
</td>
74+
<td>
75+
<a href="">Release Notes</a>
76+
</td>
77+
</tr>
78+
),
79+
)}
80+
</tbody>
81+
</table>
82+
<p>
83+
You can find past versions of this project on{' '}
84+
<a href={repoUrl}>GitHub</a>.
85+
</p>
86+
</div>
87+
</Container>
88+
</div>
89+
);
90+
}
91+
92+
module.exports = Versions;

0 commit comments

Comments
 (0)