From f657b4c4ae027094b76d900e607b7fab41a00b4f Mon Sep 17 00:00:00 2001 From: slorber Date: Fri, 19 Jun 2020 17:22:28 +0200 Subject: [PATCH] doc components initial simplification --- .../docusaurus-theme-classic/src/theme/DocPage/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/docusaurus-theme-classic/src/theme/DocPage/index.js b/packages/docusaurus-theme-classic/src/theme/DocPage/index.js index f73c73cfc9..5dc094eb1b 100644 --- a/packages/docusaurus-theme-classic/src/theme/DocPage/index.js +++ b/packages/docusaurus-theme-classic/src/theme/DocPage/index.js @@ -44,14 +44,15 @@ function DocPageContent({currentDocRoute, docsMetadata, children}) { ); } +// TODO can this be abstracted into the plugin instead of the theme? function DocPage(props) { const { - route: {routes: subroutes}, + route: {routes: docRoutes}, docsMetadata, location, } = props; - const currentDocRoute = subroutes.find((subroute) => - matchPath(location.pathname, subroute), + const currentDocRoute = docRoutes.find((docRoute) => + matchPath(location.pathname, docRoute), ); if (!currentDocRoute) { return ; @@ -61,7 +62,7 @@ function DocPage(props) { - {renderRoutes(subroutes)} + {renderRoutes(docRoutes)} );