Skip to content

Commit fbf9e0d

Browse files
committed
chore: add redirect on click icon
1 parent a8423cc commit fbf9e0d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/navbar/navbar.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,12 @@ const Component: React.FC<Props> = ({ children, className }) => {
126126
}, [metadata?.enable_substrate, metadata?.enable_evm])
127127

128128
const handleSearch = (e: KeyboardEvent<HTMLInputElement>) => {
129-
if (e.key === 'Enter' && value.trim()) {
129+
if (e.key === 'Enter') {
130+
handleRedirect()
131+
}
132+
}
133+
const handleRedirect = () => {
134+
if (value.trim()) {
130135
switch (type[0]) {
131136
case 'sub_block':
132137
router.push(`/sub/block/${value.trim()}`)
@@ -399,7 +404,7 @@ const Component: React.FC<Props> = ({ children, className }) => {
399404
<Divider orientation="vertical" className='mx-4'/>
400405
</div>
401406
}
402-
endContent={<SearchIcon fill="none" size={24} className="mr-3"/>}
407+
endContent={<SearchIcon fill="none" size={24} onClick={handleRedirect} className="mr-3 cursor-pointer"/>}
403408
/>
404409
</div>
405410
</div>

0 commit comments

Comments
 (0)