1- import  {  PiMagnifyingGlass  }  from  'react-icons/pi' ; 
2- import  {  Link  as  RemixLink ,  useLocation  }  from  "@remix-run/react" ; 
3- import  {  Container ,  Navbar  }  from  'react-bootstrap' ; 
1+ import  {  PiBlueprint ,  PiBlueprintBold ,  PiLink ,  PiMagnifyingGlass ,  PiMagnifyingGlassBold ,  PiPlay ,  PiPlayBold ,  PiUsersThree ,  PiUsersThreeBold  }  from  'react-icons/pi' ; 
2+ import  {  Link  as  RemixLink  }  from  "@remix-run/react" ; 
43
54import  RegexZoneSvg  from  '../Logos/RegexZoneSvg' ; 
5+ import  {  NavbarLink ,  NavbarLinkItem  }  from  '~/components/NavbarLink' ; 
66
7- const  links  =  [ 
8-     {  link : '/patterns/' ,  label : 'Patterns'  } , 
9-     //{ link: '/docs/', label: 'Docs' }, 
10-     {  link : 'https://www.regexplanet.com/' ,  label : 'Testing'  } , 
11-     //{ link: 'https://github.com/regexplanet/regex-zone/discussions', label: 'Community' }, 
12-     {  link : '/search.html' ,  label : 'Search'  } , 
13-     {  link : '/404' ,  label : '404'  } , 
7+ const  links :NavbarLinkItem [ ]  =  [ 
8+     {  link : '/patterns/' ,  label : 'Patterns' ,  icon : < PiBlueprint  /> ,  icon_bold : < PiBlueprintBold  />  } , 
9+     {  link : '/links/' ,  label : 'Links' ,  icon : < PiLink  /> ,  icon_bold : < PiLink  />  } , 
10+     {  link : '/testing/' ,  label : 'Testing' ,  icon : < PiPlay  /> ,  icon_bold : < PiPlayBold  />  } , 
11+     {  link : '/sharing/' ,  label : 'Sharing' ,  icon : < PiUsersThree  /> ,  icon_bold : < PiUsersThreeBold  />  } , 
12+     {  link : '/search.html' ,  label : 'Search' ,  icon : < PiMagnifyingGlass  /> ,  icon_bold : < PiMagnifyingGlassBold  />  } , 
1413] ; 
1514
1615export  function  HeaderSearch ( )  { 
17-     const  {  pathname }  =  useLocation ( ) ; 
1816
19-     const  items  =  links . map ( ( link )  =>  ( 
20-         < li  className = "nav-item"  key  =  { link . label }  > 
21-         < RemixLink 
22-             className = { pathname . startsWith ( link . link )  ? 'nav-link active fw-bold'  : 'nav-link' } 
23-             to = { link . link } 
24-         > 
25-             { link . label } 
26-         </ RemixLink > 
27-         </ li > 
28-     ) ) ; 
17+     const  items  =  links . map ( ( link ,  index )  =>  ( < NavbarLink  key = { `key${ index }  ` }  link = { link }  /> ) ) ; 
2918
3019    return  ( 
3120        < > 
32-             < Navbar  className = "bg-body-tertiary border-bottom" > 
33-                 < Container > 
34-                     < Navbar . Brand   as = { RemixLink }  className = "fw-bold"  to = "/" > 
35-                         < RegexZoneSvg  height = { '2rem' }  className = "pe-2"  /> 
21+             < nav  className = "navbar navbar-expand  bg-body-tertiary border-bottom" > 
22+                 < div   className = "container-lg" > 
23+                     < RemixLink  className = "navbar-brand fs-4  fw-bold"  to = "/" > 
24+                         < RegexZoneSvg  height = { '2rem' }  className = "pe-2 d-none d-md-inline "  /> 
3625                        Regex Zone
37-                     </ Navbar . Brand > 
26+                     </ RemixLink > 
3827                    < ul  className = "navbar-nav" > 
3928                    { items } 
4029                    </ ul > 
41-                 </ Container > 
42-             </ Navbar > 
30+                 </ div > 
31+             </ nav > 
4332        </ > 
4433    ) ; 
4534} 
0 commit comments