mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-14 16:52:39 +02:00
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:
parent
c9243e8922
commit
13a21b2374
36 changed files with 520 additions and 327 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue