Skip to content

Commit 2db9f7b

Browse files
committed
chore: update header
1 parent bd974bf commit 2db9f7b

File tree

1 file changed

+18
-24
lines changed

1 file changed

+18
-24
lines changed

components/Header.tsx

Lines changed: 18 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import Image from 'next/image';
44
import Link from 'next/link';
55
import { usePathname } from 'next/navigation';
66
import { cn } from '@/lib/utils';
7-
import { navItems } from '@/lib/constants';
87
import { SearchModal } from './SearchModal';
98

109
export const Header = ({ trendingCoins = [] }: HeaderProps) => {
@@ -23,31 +22,26 @@ export const Header = ({ trendingCoins = [] }: HeaderProps) => {
2322
</Link>
2423

2524
<nav>
26-
{navItems.map((item) => {
27-
const isActive = pathname === item.href;
25+
<Link
26+
href='/'
27+
className={cn('nav-link', {
28+
'is-active': pathname === '/',
29+
'is-home': true,
30+
})}
31+
>
32+
Home
33+
</Link>
2834

29-
if (item.label === 'Search') {
30-
return (
31-
<SearchModal
32-
key={item.label}
33-
initialTrendingCoins={trendingCoins}
34-
/>
35-
);
36-
}
35+
<SearchModal initialTrendingCoins={trendingCoins} />
3736

38-
return (
39-
<Link
40-
key={item.label}
41-
href={item.href}
42-
className={cn('nav-link', {
43-
'is-active': isActive,
44-
'is-home': item.label === 'Home',
45-
})}
46-
>
47-
{item.label}
48-
</Link>
49-
);
50-
})}
37+
<Link
38+
href='/coins'
39+
className={cn('nav-link', {
40+
'is-active': pathname === '/coins',
41+
})}
42+
>
43+
All Coins
44+
</Link>
5145
</nav>
5246
</div>
5347
</header>

0 commit comments

Comments
 (0)