mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
default sidebar
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Blog
|
||||
title: React Blog
|
||||
---
|
||||
|
||||
<Intro>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Community
|
||||
title: React Community
|
||||
---
|
||||
|
||||
<Intro>
|
||||
|
||||
@@ -6,6 +6,7 @@ import {Fragment, useMemo} from 'react';
|
||||
import {useRouter} from 'next/router';
|
||||
import {MDXComponents} from 'components/MDX/MDXComponents';
|
||||
import {Page} from 'components/Layout/Page';
|
||||
import sidebarHome from '../sidebarHome.json';
|
||||
import sidebarLearn from '../sidebarLearn.json';
|
||||
import sidebarReference from '../sidebarReference.json';
|
||||
import sidebarCommunity from '../sidebarCommunity.json';
|
||||
@@ -18,8 +19,14 @@ export default function Layout({content, toc, meta}) {
|
||||
);
|
||||
const parsedToc = useMemo(() => JSON.parse(toc, reviveNodeOnClient), [toc]);
|
||||
const section = useActiveSection();
|
||||
let routeTree = sidebarLearn;
|
||||
let routeTree;
|
||||
switch (section) {
|
||||
case 'home':
|
||||
routeTree = sidebarHome;
|
||||
break;
|
||||
case 'learn':
|
||||
routeTree = sidebarLearn;
|
||||
break;
|
||||
case 'reference':
|
||||
routeTree = sidebarReference;
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title": "React Blog",
|
||||
"title": "Blog",
|
||||
"path": "/blog",
|
||||
"routes": [
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"title": "React Community",
|
||||
"title": "Community",
|
||||
"path": "/community",
|
||||
"routes": [
|
||||
{
|
||||
|
||||
94
beta/src/sidebarHome.json
Normal file
94
beta/src/sidebarHome.json
Normal file
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"title": "React Docs",
|
||||
"path": "/",
|
||||
"routes": [
|
||||
{
|
||||
"hasSectionHeader": true,
|
||||
"sectionHeader": "Get Started"
|
||||
},
|
||||
{
|
||||
"title": "Installation",
|
||||
"path": "/learn/installation"
|
||||
},
|
||||
{
|
||||
"title": "Quick Start",
|
||||
"path": "/learn"
|
||||
},
|
||||
{
|
||||
"hasSectionHeader": true,
|
||||
"sectionHeader": "Learn React"
|
||||
},
|
||||
{
|
||||
"title": "Describing the UI",
|
||||
"path": "/learn/describing-the-ui"
|
||||
},
|
||||
{
|
||||
"title": "Adding Interactivity",
|
||||
"path": "/learn/adding-interactivity"
|
||||
},
|
||||
{
|
||||
"title": "Managing State",
|
||||
"path": "/learn/managing-state"
|
||||
},
|
||||
{
|
||||
"title": "Escape Hatches",
|
||||
"path": "/learn/escape-hatches"
|
||||
},
|
||||
{
|
||||
"hasSectionHeader": true,
|
||||
"sectionHeader": "Reference (react)"
|
||||
},
|
||||
{
|
||||
"title": "Components",
|
||||
"path": "/reference/react/components"
|
||||
},
|
||||
{
|
||||
"title": "Hooks",
|
||||
"path": "/reference/react"
|
||||
},
|
||||
{
|
||||
"title": "APIs",
|
||||
"path": "/reference/react/apis"
|
||||
},
|
||||
{
|
||||
"title": "Legacy APIs",
|
||||
"path": "/reference/react/legacy"
|
||||
},
|
||||
{
|
||||
"hasSectionHeader": true,
|
||||
"sectionHeader": "Reference (react-dom)"
|
||||
},
|
||||
{
|
||||
"title": "Components",
|
||||
"path": "/reference/react-dom/components"
|
||||
},
|
||||
{
|
||||
"title": "APIs",
|
||||
"path": "/reference/react-dom"
|
||||
},
|
||||
{
|
||||
"title": "Client APIs",
|
||||
"path": "/reference/react-dom/client"
|
||||
},
|
||||
{
|
||||
"title": "Server APIs",
|
||||
"path": "/reference/react-dom/server"
|
||||
},
|
||||
{
|
||||
"hasSectionHeader": true,
|
||||
"sectionHeader": "Get Involved"
|
||||
},
|
||||
{
|
||||
"title": "React Community",
|
||||
"path": "/community"
|
||||
},
|
||||
{
|
||||
"hasSectionHeader": true,
|
||||
"sectionHeader": "Stay Informed"
|
||||
},
|
||||
{
|
||||
"title": "React Blog",
|
||||
"path": "/blog"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user