@@ -19,7 +19,7 @@ const Coins = async ({
1919} ) => {
2020 const params = await searchParams ;
2121 const currentPage = Number ( params . page ) || 1 ;
22- const perPage = 8 ;
22+ const perPage = 10 ;
2323
2424 const coinsData = await getCoinList ( currentPage , perPage ) ;
2525
@@ -34,65 +34,73 @@ const Coins = async ({
3434
3535 return (
3636 < main className = 'py-12 container size-full items-center gap-10 justify-center' >
37- < div className = 'flex flex-col w-full space-y-4 ' >
37+ < div className = 'flex flex-col w-full space-y-5 ' >
3838 < h4 className = 'text-2xl' > All Coins</ h4 >
39- < Table className = 'bg-dark-500 rounded-lg overflow-hidden' >
40- < TableHeader className = 'bg-dark-400 text-purple-100' >
41- < TableRow className = 'hover:bg-transparent !border-purple-600 ' >
42- < TableHead className = 'pl-5 py-4 text-purple-100' > Rank</ TableHead >
43- < TableHead className = 'text-purple-100' > Token</ TableHead >
44- < TableHead className = 'text-purple-100' > Price</ TableHead >
45- < TableHead className = 'pr-8 text-purple-100' > 24h Change</ TableHead >
46- < TableHead className = 'pr-8 text-purple-100' > Market Cap</ TableHead >
47- </ TableRow >
48- </ TableHeader >
49- < TableBody >
50- { coinsData . map ( ( coin : CoinMarketData ) => {
51- const isTrendingUp = coin . price_change_percentage_24h > 0 ;
52- return (
53- < ClickableTableRow
54- key = { coin . id }
55- href = { `/coins/${ coin . id } ` }
56- className = 'text-lg hover:!bg-dark-400/30 !border-purple-600 cursor-pointer'
57- >
58- < TableCell className = 'pl-5 !max-w-[80px] py-5 font-medium text-purple-100' >
59- #{ coin . market_cap_rank }
60- </ TableCell >
61- < TableCell className = 'py-3 font-semibold' >
62- < div className = 'flex items-center gap-3' >
63- < Image
64- src = { coin . image }
65- alt = { coin . name }
66- width = { 36 }
67- height = { 36 }
68- />
69- < p >
70- { coin . name } ({ coin . symbol . toUpperCase ( ) } )
71- </ p >
72- </ div >
73- </ TableCell >
74- < TableCell className = 'py-4 font-medium' >
75- { formatPrice ( coin . current_price ) }
76- </ TableCell >
77- < TableCell className = 'font-medium' >
78- < span
79- className = { cn ( 'flex gap-1 items-center font-medium' , {
80- 'text-green-600' : isTrendingUp ,
81- 'text-red-500' : ! isTrendingUp ,
82- } ) }
83- >
84- { isTrendingUp && '+' }
85- { formatPercentage ( coin . price_change_percentage_24h ) }
86- </ span >
87- </ TableCell >
88- < TableCell className = 'pr-5 font-medium' >
89- { formatPrice ( coin . market_cap ) }
90- </ TableCell >
91- </ ClickableTableRow >
92- ) ;
93- } ) }
94- </ TableBody >
95- </ Table >
39+ < div className = 'bg-dark-500 rounded-xl custom-scrollbar max-h-fit overflow-hidden' >
40+ < Table >
41+ < TableHeader className = 'bg-dark-400 text-purple-100' >
42+ < TableRow className = 'hover:bg-transparent !border-purple-600 ' >
43+ < TableHead className = 'pl-5 py-4 text-purple-100' >
44+ Rank
45+ </ TableHead >
46+ < TableHead className = 'text-purple-100' > Token</ TableHead >
47+ < TableHead className = 'text-purple-100' > Price</ TableHead >
48+ < TableHead className = 'pr-8 text-purple-100' >
49+ 24h Change
50+ </ TableHead >
51+ < TableHead className = 'pr-8 text-purple-100' >
52+ Market Cap
53+ </ TableHead >
54+ </ TableRow >
55+ </ TableHeader >
56+ < TableBody >
57+ { coinsData . map ( ( coin : CoinMarketData ) => {
58+ const isTrendingUp = coin . price_change_percentage_24h > 0 ;
59+ return (
60+ < ClickableTableRow
61+ key = { coin . id }
62+ href = { `/coins/${ coin . id } ` }
63+ className = 'text-lg hover:!bg-dark-400/30 !border-purple-600 cursor-pointer'
64+ >
65+ < TableCell className = 'pl-5 !max-w-[80px] py-5 font-medium text-purple-100' >
66+ #{ coin . market_cap_rank }
67+ </ TableCell >
68+ < TableCell className = 'py-3 font-semibold' >
69+ < div className = 'flex items-center gap-3' >
70+ < Image
71+ src = { coin . image }
72+ alt = { coin . name }
73+ width = { 36 }
74+ height = { 36 }
75+ />
76+ < p >
77+ { coin . name } ({ coin . symbol . toUpperCase ( ) } )
78+ </ p >
79+ </ div >
80+ </ TableCell >
81+ < TableCell className = 'py-4 font-medium' >
82+ { formatPrice ( coin . current_price ) }
83+ </ TableCell >
84+ < TableCell className = 'font-medium' >
85+ < span
86+ className = { cn ( 'flex gap-1 items-center font-medium' , {
87+ 'text-green-600' : isTrendingUp ,
88+ 'text-red-500' : ! isTrendingUp ,
89+ } ) }
90+ >
91+ { isTrendingUp && '+' }
92+ { formatPercentage ( coin . price_change_percentage_24h ) }
93+ </ span >
94+ </ TableCell >
95+ < TableCell className = 'pr-5 font-medium' >
96+ { formatPrice ( coin . market_cap ) }
97+ </ TableCell >
98+ </ ClickableTableRow >
99+ ) ;
100+ } ) }
101+ </ TableBody >
102+ </ Table >
103+ </ div >
96104
97105 < CoinsPagination
98106 currentPage = { currentPage }
0 commit comments