@@ -4,8 +4,11 @@ import { useEffect, useRef, useState } from "react";
4
4
interface NavBarProps {
5
5
isOpen : boolean ;
6
6
setIsOpen : React . Dispatch < React . SetStateAction < boolean > > ;
7
+
7
8
isSearchOpen : boolean ;
8
9
setIsSearchOpen : React . Dispatch < React . SetStateAction < boolean > > ;
10
+ isSearchOpen2 : boolean ;
11
+ setIsSearchOpen2 : React . Dispatch < React . SetStateAction < boolean > > ;
9
12
isVideoOpen : boolean ;
10
13
setIsVideoOpen : React . Dispatch < React . SetStateAction < boolean > > ;
11
14
isProfileTileOpen : boolean ;
@@ -30,8 +33,10 @@ export function NavBar({
30
33
videoIconRef,
31
34
bellIconRef,
32
35
profileIconRef,
36
+ isSearchOpen2,
37
+ setIsSearchOpen2
33
38
} : NavBarProps ) {
34
- const [ isSearchOpen2 , setIsSearchOpen2 ] = useState ( false ) ;
39
+
35
40
const [ isInputFocused , setIsInputFocused ] = useState ( false ) ;
36
41
37
42
useEffect ( ( ) => {
@@ -88,7 +93,8 @@ export function NavBar({
88
93
return (
89
94
< div className = " top-0 fixed w-full z-20 bg-[#0F0F0F]" >
90
95
< div className = "flex justify-between px-5 py-3 items-center" >
91
- { isSearchOpen == false && (
96
+ {
97
+ isSearchOpen == false && (
92
98
< div className = " flex " >
93
99
< div
94
100
className = "flex gap-4 items-center "
@@ -146,10 +152,10 @@ export function NavBar({
146
152
) }
147
153
148
154
< div className = "flex justify-end sm:justify-between grow " >
149
- < div className = " flex sm:mx-auto sm:w-[60%]" >
155
+ < div className = { isSearchOpen ? ' flex px-3 w-[100%] ' : 'flex sm:mx-auto sm:w-[60%] ' } >
150
156
{ isSearchOpen2 == true && (
151
157
< input
152
- className = "bg-transparent border border-[#282828] p-2 rounded-l-full pl-4 w-[100%] "
158
+ className = "bg-transparent border outline-1 border-[#282828] p-2 rounded-l-full pl-4 w-[100%] "
153
159
placeholder = "Search"
154
160
onFocus = { handleFocus }
155
161
onBlur = { handleBlur }
@@ -181,7 +187,7 @@ export function NavBar({
181
187
) }
182
188
183
189
{ isSearchOpen == true && (
184
- < div className = "py-3 bg-transparent sm:bg- [#282828] sm: px-4 rounded-r-full flex items-center" >
190
+ < div className = "py-3 bg-[#282828] px-4 rounded-r-full flex items-center" >
185
191
< svg
186
192
xmlns = "http://www.w3.org/2000/svg"
187
193
fill = "none"
0 commit comments