MCPcopy Create free account
hub / github.com/github/docs / restSection

Function restSection

components/sidebar/SidebarProduct.tsx:79–172  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

77 )
78
79 const restSection = () => {
80 const conceptualPages = currentProductTree.childPages.filter(
81 (page) =>
82 page.href.includes('guides') ||
83 page.href.includes('overview') ||
84 page.href.includes('quickstart')
85 )
86 const restPages = currentProductTree.childPages.filter(
87 (page) =>
88 !page.href.includes('guides') &&
89 !page.href.includes('overview') &&
90 !page.href.includes('quickstart')
91 )
92 return (
93 <>
94 <li className="mt-2 mb-3">
95 <ul className="list-style-none">
96 {conceptualPages.map((childPage, i) => {
97 const isStandaloneCategory = childPage.documentType === 'article'
98 const childTitle = childPage.shortTitle || childPage.title
99 const isActive =
100 routePath.includes(childPage.href + '/') || routePath === childPage.href
101 const defaultOpen = hasExactCategory ? isActive : false
102
103 return (
104 <li
105 key={childPage.href + i}
106 data-is-active-category={isActive}
107 data-is-current-page={isActive && isStandaloneCategory}
108 className={cx('py-1', isActive && 'color-bg-inset')}
109 >
110 {childPage.href.includes('quickstart') ? (
111 <Link
112 href={childPage.href}
113 className={cx(
114 'd-block pl-4 pr-5 py-1 color-fg-default text-bold no-underline width-full'
115 )}
116 >
117 {childTitle}
118 </Link>
119 ) : (
120 <ProductCollapsibleSection
121 defaultOpen={defaultOpen}
122 routePath={routePath}
123 title={childTitle}
124 page={childPage}
125 />
126 )}
127 </li>
128 )
129 })}
130 </ul>
131 </li>
132 <div className="my-3">
133 <div
134 role="separator"
135 aria-hidden="true"
136 data-view-component="true"

Callers 1

SidebarProductFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected