-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearcherBar.tsx
More file actions
46 lines (44 loc) · 1.47 KB
/
SearcherBar.tsx
File metadata and controls
46 lines (44 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { cn } from '@/lib/utils';
import { Search } from 'lucide-react';
import { ChainLink } from '@/components/ChainLink';
import { Button } from '@/components/ui/button';
import { Input } from '@/components/ui/input';
import useUserStore from '@/stores/useUser.store';
export function SearcherBar({ className }: { className?: string }) {
const { isConnected, address: userAddress } = useUserStore();
return (
<div className={cn('m-auto w-full', className)}>
<div className="relative w-full">
<Input
className={cn(
'bg-input border-secondary w-full rounded-2xl py-5.5 pl-12 sm:py-6.5',
isConnected && 'sm:pr-32'
)}
placeholder="Search address or id or transaction"
/>
<Search
size="18"
className="pointer-events-none absolute top-1/2 left-4 -translate-y-1/2 sm:left-6"
/>
{isConnected && (
<Button
variant="outline"
className="bg-input hover:bg-secondary absolute top-1/2 right-4 hidden -translate-y-1/2 sm:flex"
asChild
>
<ChainLink to={`/address/${userAddress}`}>My activity</ChainLink>
</Button>
)}
</div>
{isConnected && (
<Button
variant="outline"
className="mx-auto mt-4 flex w-fit sm:hidden"
asChild
>
<ChainLink to={`/address/${userAddress}`}>My activity</ChainLink>
</Button>
)}
</div>
);
}