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

@ -5,14 +5,21 @@
* LICENSE file in the root directory of this source tree.
*/
import React from 'react';
import React, {useContext} from 'react';
import {NavLink} from 'react-router-dom';
import Search from '@theme/Search';
import DocusaurusContext from '@docusaurus/context';
import styles from './styles.module.css';
function Navbar(props) {
const {siteConfig = {}, env = {}, metadata = {}, docsMetadatas = {}} = props;
const context = useContext(DocusaurusContext);
const {
siteConfig = {},
env = {},
metadata = {},
docsMetadatas = {},
} = context;
const {baseUrl, headerLinks, headerIcon, algolia} = siteConfig;
const {language: thisLanguage, version: thisVersion} = metadata;