1+ import Link from 'next/link' ;
2+ import { ArrowUpRight } from 'lucide-react' ;
3+
14import {
25 getCoinDetails ,
36 getCoinOHLC ,
@@ -9,8 +12,6 @@ import LiveDataWrapper from '@/components/LiveDataWrapper';
912import { TopGainersLosers } from '@/components/coin-details/TopGainersLosers' ;
1013import { DataTable } from '@/components/DataTable' ;
1114import { formatPrice , timeAgo } from '@/lib/utils' ;
12- import Link from 'next/link' ;
13- import { ArrowUpRight } from 'lucide-react' ;
1415
1516const CoinDetails = async ( { params } : { params : Promise < { id : string } > } ) => {
1617 const { id } = await params ;
@@ -58,72 +59,83 @@ const CoinDetails = async ({ params }: { params: Promise<{ id: string }> }) => {
5859 const exchangeColumns = [
5960 {
6061 header : 'Exchange' ,
61- cellClassName : 'text-green-500 font-bold ' ,
62+ cellClassName : 'exchange-name ' ,
6263 cell : ( ticker : Ticker ) => (
63- < Link href = { ticker . trade_url } target = '_blank' className = 'exchange-link' >
64+ < >
6465 { ticker . market . name }
65- </ Link >
66+
67+ < Link
68+ href = { ticker . trade_url }
69+ target = '_blank'
70+ aria-label = 'View coin'
71+ />
72+ </ >
6673 ) ,
6774 } ,
6875 {
6976 header : 'Pair' ,
7077 cell : ( ticker : Ticker ) => (
71- < div className = 'exchange- pair' >
72- < p className = 'truncate max-w-[100px] h-full' > { ticker . base } </ p > /
73- < p className = 'truncate max-w-[100px] h-full ml-2' > { ticker . target } </ p >
78+ < div className = 'pair' >
79+ < p > { ticker . base } </ p >
80+ < p > { ticker . target } </ p >
7481 </ div >
7582 ) ,
7683 } ,
7784 {
7885 header : 'Price' ,
79- cellClassName : 'font-medium ' ,
86+ cellClassName : 'price-cell ' ,
8087 cell : ( ticker : Ticker ) => formatPrice ( ticker . converted_last . usd ) ,
8188 } ,
8289 {
8390 header : 'Last Traded' ,
8491 headClassName : 'text-end' ,
85- cellClassName : 'exchange-timestamp ' ,
92+ cellClassName : 'time-cell ' ,
8693 cell : ( ticker : Ticker ) => timeAgo ( ticker . timestamp ) ,
8794 } ,
8895 ] ;
8996
9097 return (
91- < main className = 'coin-details-main ' >
92- < section className = 'size-full xl:col-span-2 ' >
98+ < main id = 'coin-details-page ' >
99+ < section className = 'primary ' >
93100 < LiveDataWrapper
94101 coinId = { id }
95102 poolId = { pool . id }
96103 coin = { coinData }
97104 coinOHLCData = { coinOHLCData }
98105 >
99- < div className = 'w-full mt-8 space-y-4' >
100- < h4 className = 'section-title' > Exchange Listings</ h4 >
101- < div className = 'custom-scrollbar mt-5 exchange-container' >
102- < DataTable
103- columns = { exchangeColumns }
104- data = { coinData . tickers . slice ( 0 , 7 ) }
105- rowKey = { ( _ , index ) => index }
106- />
107- </ div >
106+ < div className = 'exchange-section' >
107+ < h4 > Exchange Listings</ h4 >
108+
109+ < DataTable
110+ tableClassName = 'exchange-table'
111+ columns = { exchangeColumns }
112+ data = { coinData . tickers . slice ( 0 , 7 ) }
113+ rowKey = { ( _ , index ) => index }
114+ headerCellClassName = 'py-4! bg-dark-400 text-purple-100'
115+ bodyCellClassName = 'py-2!'
116+ bodyRowClassName = 'relative'
117+ />
108118 </ div >
109119 </ LiveDataWrapper >
110120 </ section >
111121
112- < section className = 'size-full max-lg:mt-8 lg:col-span-1 ' >
122+ < section className = 'secondary ' >
113123 < Converter
114124 symbol = { coinData . symbol }
115125 icon = { coinData . image . small }
116126 priceList = { coinData . market_data . current_price }
117127 />
118128
119- < div className = 'w-full mt-8 space-y-4' >
120- < h4 className = 'section-title pb-3' > Coin Details</ h4 >
121- < div className = 'coin-details-grid' >
129+ < div className = 'details' >
130+ < h4 > Coin Details</ h4 >
131+
132+ < ul className = 'details-grid' >
122133 { coinDetails . map ( ( { label, value, link, linkText } , index ) => (
123- < div key = { index } className = 'detail-card' >
124- < p className = 'text-purple-100' > { label } </ p >
134+ < li key = { index } >
135+ < p className = 'label' > { label } </ p >
136+
125137 { link ? (
126- < div className = 'detail- link' >
138+ < div className = 'link' >
127139 < Link href = { link } target = '_blank' >
128140 { linkText || label }
129141 </ Link >
@@ -132,9 +144,9 @@ const CoinDetails = async ({ params }: { params: Promise<{ id: string }> }) => {
132144 ) : (
133145 < p className = 'text-base font-medium' > { value } </ p >
134146 ) }
135- </ div >
147+ </ li >
136148 ) ) }
137- </ div >
149+ </ ul >
138150 </ div >
139151
140152 < TopGainersLosers />
0 commit comments