File tree Expand file tree Collapse file tree 1 file changed +18
-24
lines changed
Expand file tree Collapse file tree 1 file changed +18
-24
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ import Image from 'next/image';
44import Link from 'next/link' ;
55import { usePathname } from 'next/navigation' ;
66import { cn } from '@/lib/utils' ;
7- import { navItems } from '@/lib/constants' ;
87import { SearchModal } from './SearchModal' ;
98
109export 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 >
You can’t perform that action at this time.
0 commit comments