mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
[Website] First pass at Algolia Doc Search
It’s not yet responsive :(
This commit is contained in:
22
website/core/AlgoliaDocSearch.js
Normal file
22
website/core/AlgoliaDocSearch.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (c) 2015-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.
|
||||
*
|
||||
* @providesModule AlgoliaDocSearch
|
||||
*/
|
||||
|
||||
var AlgoliaDocSearch = React.createClass({
|
||||
render: function() {
|
||||
return (
|
||||
<div className="algolia-search-wrapper">
|
||||
<input id="algolia-doc-search" type="text" placeholder="Search docs..." />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = AlgoliaDocSearch;
|
||||
@@ -10,6 +10,7 @@
|
||||
*/
|
||||
|
||||
var React = require('React');
|
||||
var AlgoliaDocSearch = require('AlgoliaDocSearch');
|
||||
|
||||
var HeaderLinks = React.createClass({
|
||||
linksInternal: [
|
||||
@@ -44,6 +45,9 @@ var HeaderLinks = React.createClass({
|
||||
<ul className="nav-site nav-site-internal">
|
||||
{this.makeLinks(this.linksInternal)}
|
||||
</ul>
|
||||
|
||||
<AlgoliaDocSearch />
|
||||
|
||||
<ul className="nav-site nav-site-external">
|
||||
{this.makeLinks(this.linksExternal)}
|
||||
</ul>
|
||||
|
||||
@@ -29,6 +29,8 @@ var Site = React.createClass({
|
||||
<meta property="og:image" content="http://facebook.github.io/react-native/img/opengraph.png?2" />
|
||||
<meta property="og:description" content="A framework for building native apps using React" />
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css" />
|
||||
|
||||
<link rel="shortcut icon" href="/react-native/img/favicon.png?2" />
|
||||
<link rel="stylesheet" href="/react-native/css/react-native.css" />
|
||||
|
||||
@@ -68,6 +70,7 @@ var Site = React.createClass({
|
||||
){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";
|
||||
fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");
|
||||
`}} />
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script>
|
||||
<script src="/react-native/js/scripts.js" />
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user