File tree Expand file tree Collapse file tree 15 files changed +223
-341
lines changed Expand file tree Collapse file tree 15 files changed +223
-341
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,11 @@ export const Breadcrumbs = ({ variant = 'default' }: Props) => {
5151              { breadcrumb . title } 
5252            </ Link > 
5353          ) , 
54-           i  !==  arr . length  -  1  ? < span  className = "color-text-tertiary" > /</ span >  : null , 
54+           i  !==  arr . length  -  1  ? ( 
55+             < span  className = "color-text-tertiary"  key = { `${ i }  -slash` } > 
56+               /
57+             </ span > 
58+           )  : null , 
5559        ] 
5660      } ) } 
5761    </ nav > 
Original file line number Diff line number Diff line change 11import  Head  from  'next/head' 
22
3- import  {  SidebarNav  }  from  'components/SidebarNav' 
3+ import  {  SidebarNav  }  from  'components/sidebar/ SidebarNav' 
44import  {  Header  }  from  'components/page-header/Header' 
55import  {  SmallFooter  }  from  'components/page-footer/SmallFooter' 
66import  {  ScrollButton  }  from  'components/ScrollButton' 
  Load Diff This file was deleted. 
Original file line number Diff line number Diff line change @@ -207,38 +207,11 @@ function initExitEvent() {
207207  document . addEventListener ( 'visibilitychange' ,  sendExit ) 
208208} 
209209
210- function  initNavigateEvent ( )  { 
211-   if  ( ! document . querySelector ( '.sidebar-products' ) )  return 
212- 
213-   Array . from ( document . querySelectorAll ( '.sidebar-products details' ) ) . forEach ( ( details )  => 
214-     details . addEventListener ( 'toggle' ,  ( evt )  =>  { 
215-       const  target  =  evt . target  as  HTMLDetailsElement 
216-       sendEvent ( { 
217-         type : EventType . navigate , 
218-         navigate_label : `details ${ target . open  ? 'open'  : 'close' }  : ${  
219-           target ?. querySelector ( 'summary' ) ?. innerText  
220-         }  `, 
221-       } ) 
222-     } ) 
223-   ) 
224- 
225-   document . querySelector ( '.sidebar-products' ) ?. addEventListener ( 'click' ,  ( evt )  =>  { 
226-     const  target  =  evt . target  as  HTMLElement 
227-     const  link  =  target . closest ( 'a' )  as  HTMLAnchorElement 
228-     if  ( ! link )  return 
229-     sendEvent ( { 
230-       type : EventType . navigate , 
231-       navigate_label : `link: ${ link . href }  ` , 
232-     } ) 
233-   } ) 
234- } 
235- 
236210export  default  function  initializeEvents ( )  { 
237211  initPageEvent ( )  // must come first 
238212  initExitEvent ( ) 
239213  initLinkEvent ( ) 
240214  initClipboardEvent ( ) 
241-   initNavigateEvent ( ) 
242215  // print event in ./print.js 
243216  // survey event in ./survey.js 
244217  // experiment event in ./experiment.js 
File renamed without changes.
Original file line number Diff line number Diff line change 1+ import  {  useRouter  }  from  'next/router' 
2+ import  {  LinkExternalIcon  }  from  '@primer/octicons-react' 
3+ 
4+ import  {  useVersion  }  from  'components/hooks/useVersion' 
5+ import  {  useMainContext  }  from  'components/context/MainContext' 
6+ import  {  Link  }  from  'components/Link' 
7+ 
8+ import  {  AllProductsLink  }  from  './AllProductsLink' 
9+ 
10+ export  const  SidebarHomepage  =  ( )  =>  { 
11+   const  router  =  useRouter ( ) 
12+   const  {  currentVersion }  =  useVersion ( ) 
13+   const  {  activeProducts,  isFPT }  =  useMainContext ( ) 
14+ 
15+   return  ( 
16+     < ul  data-testid = "sidebar"  className = "mt-4" > 
17+       { ! isFPT  &&  < AllProductsLink  /> } 
18+ 
19+       { activeProducts . map ( ( product )  =>  { 
20+         if  ( ! isFPT  &&  ! product . versions ?. includes ( currentVersion )  &&  ! product . external )  { 
21+           return  null 
22+         } 
23+ 
24+         const  href  =  `${ ! product . external  ? `/${ router . locale }  `  : '' } ${  
25+           product . versions ?. includes ( currentVersion )  &&  ! isFPT  
26+             ? `/${ currentVersion }  /${ product . id }  `  
27+             : product . href  
28+         }  `
29+ 
30+         return  ( 
31+           < li 
32+             key = { product . id } 
33+             title = { `${ product . name } ${ product . external  ? '(External Site)'  : '' }  ` } 
34+             className = "my-3" 
35+           > 
36+             < Link 
37+               href = { href } 
38+               target = { product . external  ? '_blank'  : undefined } 
39+               className = "f4 pl-4 pr-5 py-2 color-text-primary no-underline" 
40+             > 
41+               { product . name } 
42+               { product . external  &&  ( 
43+                 < span  className = "ml-1" > 
44+                   < LinkExternalIcon  size = "small"  /> 
45+                 </ span > 
46+               ) } 
47+             </ Link > 
48+           </ li > 
49+         ) 
50+       } ) } 
51+     </ ul > 
52+   ) 
53+ } 
Original file line number Diff line number Diff line change 1+ import  {  useRouter  }  from  'next/router' 
2+ import  {  MarkGithubIcon  }  from  '@primer/octicons-react' 
3+ 
4+ import  {  Link  }  from  'components/Link' 
5+ import  {  useTranslation  }  from  'components/hooks/useTranslation' 
6+ import  {  useMainContext  }  from  'components/context/MainContext' 
7+ import  {  SidebarProduct  }  from  './SidebarProduct' 
8+ import  {  SidebarHomepage  }  from  './SidebarHomepage' 
9+ 
10+ export  const  SidebarNav  =  ( )  =>  { 
11+   const  router  =  useRouter ( ) 
12+   const  {  error,  relativePath }  =  useMainContext ( ) 
13+   const  {  t }  =  useTranslation ( 'header' ) 
14+ 
15+   return  ( 
16+     < div 
17+       className = "d-none d-lg-block color-bg-tertiary position-sticky top-0 overflow-y-auto flex-shrink-0 pb-5" 
18+       style = { {  width : 286 ,  height : '100vh'  } } 
19+     > 
20+       < div 
21+         className = "d-flex flex-items-center p-4 position-sticky top-0 color-bg-tertiary" 
22+         style = { {  zIndex : 3  } } 
23+         id = "github-logo" 
24+         role = "banner" 
25+       > 
26+         < Link 
27+           href = { `/${ router . locale }  ` } 
28+           className = "color-text-primary" 
29+           aria-hidden = "true" 
30+           tabIndex = { - 1 } 
31+         > 
32+           < MarkGithubIcon  size = { 32 }  /> 
33+         </ Link > 
34+         < Link 
35+           href = { `/${ router . locale }  ` } 
36+           className = "h4-mktg color-text-primary no-underline no-wrap pl-2 flex-auto" 
37+         > 
38+           { t ( 'github_docs' ) } 
39+         </ Link > 
40+       </ div > 
41+       < nav > 
42+         { error  ===  '404'  ||  relativePath  ===  'index.md'  ? < SidebarHomepage  />  : < SidebarProduct  /> } 
43+       </ nav > 
44+     </ div > 
45+   ) 
46+ } 
Original file line number Diff line number Diff line change 1+ .sidebarArticle ::before  {
2+   content : " "  ;
3+   position  : absolute ;
4+   left  : 26px  ;
5+   height  : 100%  ;
6+   border-left  : 1px   solid  var (--color-text-primary );
7+   width  : 1px  ;
8+   top  : 0 ;
9+ }
10+ 
11+ .sidebarArticleActive ::before  {
12+   border-left-width  : 2px  ;
13+ }
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments