mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-25 20:48:50 +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
|
@ -5,14 +5,17 @@
|
|||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import React, {useContext} from 'react';
|
||||
|
||||
import DocusaurusContext from '@docusaurus/context';
|
||||
import SidebarLink from './SidebarLink';
|
||||
import SidebarCategory from './SidebarCategory';
|
||||
|
||||
import styles from './styles.module.css';
|
||||
|
||||
function Sidebar(props) {
|
||||
const {metadata, docsSidebars, docsMetadatas} = props;
|
||||
function Sidebar() {
|
||||
const context = useContext(DocusaurusContext);
|
||||
const {metadata = {}, docsSidebars, docsMetadatas} = context;
|
||||
const {sidebar, language} = metadata;
|
||||
|
||||
if (!sidebar) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue