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" ;
4
3
5
4
import RegexZoneSvg from '../Logos/RegexZoneSvg' ;
5
+ import { NavbarLink , NavbarLinkItem } from '~/components/NavbarLink' ;
6
6
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 /> } ,
14
13
] ;
15
14
16
15
export function HeaderSearch ( ) {
17
- const { pathname } = useLocation ( ) ;
18
16
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 } /> ) ) ;
29
18
30
19
return (
31
20
< >
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 " />
36
25
Regex Zone
37
- </ Navbar . Brand >
26
+ </ RemixLink >
38
27
< ul className = "navbar-nav" >
39
28
{ items }
40
29
</ ul >
41
- </ Container >
42
- </ Navbar >
30
+ </ div >
31
+ </ nav >
43
32
</ >
44
33
) ;
45
34
}
0 commit comments