File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import SideBar from '@node-core/ui-components/Containers/Sidebar' ;
2+
3+ /**
4+ * Redirect to a URL
5+ * @param {string } url URL
6+ */
7+ const redirect = url => ( window . location . href = url ) ;
8+
9+ /**
10+ * Sidebar component for MDX documentation with page navigation
11+ * @param {import('../Layout').Props } props
12+ */
13+ export default ( { metadata } ) => {
14+ const items = pages . map ( ( [ heading , path ] ) => ( {
15+ label : heading ,
16+ link :
17+ metadata . path === path
18+ ? `${ metadata . basename } .html`
19+ : `${ relative ( path , metadata . path ) } .html` ,
20+ } ) ) ;
21+
22+ return (
23+ < SideBar
24+ pathname = { `${ metadata . basename } .html` }
25+ groups = { [ { groupName : 'Learn Articles' , items } ] }
26+ onSelect = { redirect }
27+ as = { props => < a { ...props } rel = "prefetch" /> }
28+ title = "Navigation"
29+ />
30+ ) ;
31+ } ;
You can’t perform that action at this time.
0 commit comments