Skip to content

Commit 8e45c4b

Browse files
committed
Added versions page with links to recent releases
1 parent ae0b953 commit 8e45c4b

File tree

2 files changed

+74
-2
lines changed

2 files changed

+74
-2
lines changed

src/components/LayoutHeader/Header.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import HeaderLink from './HeaderLink';
1010
import Link from 'gatsby-link';
1111
import React from 'react';
1212
import {colors, fonts, media} from 'theme';
13+
import {version} from 'site-constants';
1314
import ExternalLinkSvg from 'templates/components/ExternalLinkSvg';
1415
import DocSearch from './DocSearch';
15-
import VersionToggler from './VersionToggler';
1616

1717
import logoSvg from 'icons/logo.svg';
1818

@@ -146,7 +146,25 @@ const Header = ({location}: {location: Location}) => (
146146
width: 'calc(100% / 6)',
147147
},
148148
}}>
149-
<VersionToggler />
149+
<a
150+
css={{
151+
padding: '5px 10px',
152+
whiteSpace: 'nowrap',
153+
...fonts.small,
154+
155+
':hover': {
156+
color: colors.brand,
157+
},
158+
159+
':focus': {
160+
outline: 0,
161+
backgroundColor: colors.lighter,
162+
borderRadius: 15,
163+
},
164+
}}
165+
href="/versions">
166+
v{version}
167+
</a>
150168
<a
151169
css={{
152170
padding: '5px 10px',

src/pages/versions.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Copyright (c) 2013-present, Facebook, Inc.
3+
*
4+
* @emails react-core
5+
* @flow
6+
*/
7+
8+
import Container from 'components/Container';
9+
import Header from 'components/Header';
10+
import TitleAndMetaTags from 'components/TitleAndMetaTags';
11+
import React from 'react';
12+
import {sharedStyles} from 'theme';
13+
14+
const Versions = () => (
15+
<Container>
16+
<div css={sharedStyles.articleLayout.container}>
17+
<div css={sharedStyles.articleLayout.content}>
18+
<Header>React Versions</Header>
19+
<TitleAndMetaTags title="React - Versions" />
20+
<div css={sharedStyles.markdown}>
21+
<p>
22+
A complete release history for React is available{' '}
23+
<a
24+
href="https://github.com/facebook/react/releases"
25+
target="_blank"
26+
rel="noopener">
27+
in GitHub
28+
</a>.
29+
</p>
30+
<p>Documentation for recent releases can also be accessed below:</p>
31+
<ul>
32+
<li>
33+
<a href="/version/16.2" rel="nofollow">
34+
16.2.0
35+
</a>
36+
</li>
37+
<li>
38+
<a href="/version/16.1" rel="nofollow">
39+
16.1.1
40+
</a>
41+
</li>
42+
<li>
43+
<a href="/version/16.0" rel="nofollow">
44+
16.0.0
45+
</a>
46+
</li>
47+
</ul>
48+
</div>
49+
</div>
50+
</div>
51+
</Container>
52+
);
53+
54+
export default Versions;

0 commit comments

Comments
 (0)