@@ -5,40 +5,51 @@ import { useRouter } from 'next/router';
5
5
import { IoLogoGithub } from 'react-icons/io' ;
6
6
import { BsPeopleFill } from 'react-icons/bs' ;
7
7
8
- import Search from './Search' ;
8
+ import Search , { SearchProps } from './Search' ;
9
9
10
- function Header ( ) {
10
+
11
+ const SearchBar = ( props : SearchProps ) => {
11
12
const router = useRouter ( ) ;
12
13
14
+ return ( router . pathname === '/repos/[language]' && (
15
+ < Search { ...props } />
16
+ )
17
+ )
18
+ }
19
+
20
+ function Header ( ) {
13
21
return (
14
- < div className = "border-b-[0.5px] border-dashed border-b-2023-manga-3 flex justify-center mb-5" >
15
- < div className = "justify-between px-2 mb-2 ml-1.5 w-3/4 shadow-lg navbar rounded-box" >
16
- < Link href = "/" >
17
- < img src = "/hacktoberfest.svg" alt = "Hacktoberfest" />
18
- </ Link >
19
- { router . pathname === '/repos/[language]' && (
20
- < div className = "justify-center flex-1" >
21
- < Search />
22
- </ div >
23
- ) }
24
- < div className = "flex-none" >
25
- < Link
26
- href = "/contributors"
27
- className = "btn btn-square btn-ghost umami--click--contributors-button"
28
- >
29
- < BsPeopleFill size = "1.5rem" color = 'white' title = "Contributors" />
22
+ < header className = "border-b-[0.5px] border-dashed border-b-2023-manga-3 mb-5" >
23
+ < div className = "container mx-auto px-4 py-2" >
24
+ < div className = "justify-between shadow-lg navbar" >
25
+ < Link href = "/" >
26
+ < img src = "/hacktoberfest.svg" alt = "Hacktoberfest" className = "h-12 w-auto sm:h-auto" />
30
27
</ Link >
31
- < a
32
- href = "https://github.com/max-programming/hacktoberfest-projects"
33
- target = "_blank"
34
- rel = "noreferrer"
35
- className = "btn btn-square btn-ghost umami--click--github-button"
36
- >
37
- < IoLogoGithub size = "1.5rem" color = 'white' title = "GitHub" />
38
- </ a >
39
- </ div >
28
+
29
+ < SearchBar searchBarWrapperStyles = "hidden sm:inline-flex flex-1 max-w-md px-6" />
30
+
31
+ < div className = "flex-none" >
32
+ < Link
33
+ href = "/contributors"
34
+ className = "btn btn-square btn-ghost umami--click--contributors-button"
35
+ >
36
+ < BsPeopleFill size = "1.5rem" color = 'white' title = "Contributors" />
37
+ </ Link >
38
+
39
+ < a
40
+ href = "https://github.com/max-programming/hacktoberfest-projects"
41
+ target = "_blank"
42
+ rel = "noreferrer"
43
+ className = "btn btn-square btn-ghost umami--click--github-button"
44
+ >
45
+ < IoLogoGithub size = "1.5rem" title = "GitHub" />
46
+ </ a >
47
+ </ div >
48
+ </ div >
49
+
50
+ < SearchBar searchBarWrapperStyles = "sm:hidden px-2 mb-3" />
40
51
</ div >
41
- </ div >
52
+ </ header >
42
53
) ;
43
54
}
44
55
0 commit comments