feat(v2): rewrite docs loading strategy (#1092)

* feat(v2): rewrite docs loading strategy

* Prettify

* Lint

* Allow resolving from library root

* minor changes, refactor

* copyright header
This commit is contained in:
Yangshun Tay 2018-11-07 00:39:47 -08:00 committed by Endilie Yacop Sucipto
parent c9243e8922
commit 13a21b2374
36 changed files with 520 additions and 327 deletions

View file

@ -7,18 +7,20 @@
import React from 'react';
import DocusaurusContext from '@docusaurus/context';
import './styles.css';
class Search extends React.Component {
constructor() {
super();
constructor(props) {
super(props);
this.state = {
enabled: true,
};
}
componentDidMount() {
const {siteConfig = {}, metadata = {}} = this.props;
const {siteConfig = {}, metadata = {}} = this.context;
const {version: thisVersion, language: thisLanguage} = metadata;
const {algolia} = siteConfig;
@ -58,4 +60,6 @@ class Search extends React.Component {
}
}
Search.contextType = DocusaurusContext;
export default Search;