Skip to content

Commit 8c06fe9

Browse files
committed
refactor: datatable styles
1 parent b77f4ee commit 8c06fe9

File tree

6 files changed

+5
-12
lines changed

6 files changed

+5
-12
lines changed

app/coins/[id]/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ const CoinDetails = async ({ params }: { params: Promise<{ id: string }> }) => {
111111
columns={exchangeColumns}
112112
data={coinData.tickers.slice(0, 7)}
113113
rowKey={(_, index) => index}
114-
headerCellClassName='py-4! bg-dark-400 text-purple-100'
115114
bodyCellClassName='py-2!'
116-
bodyRowClassName='relative'
117115
/>
118116
</div>
119117
</LiveDataWrapper>

app/coins/page.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ const Coins = async ({
9090
columns={columns}
9191
data={coinsData}
9292
rowKey={(coin) => coin.id}
93-
headerCellClassName='py-4! bg-dark-400 text-purple-100'
94-
bodyCellClassName='py-4!'
95-
bodyRowClassName='relative'
9693
/>
9794

9895
<CoinsPagination

components/DataTable.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const DataTable = <T,>({
1515
tableClassName,
1616
headerClassName,
1717
headerRowClassName,
18-
headerCellClassName = 'text-purple-100',
18+
headerCellClassName,
1919
bodyRowClassName,
2020
bodyCellClassName,
2121
}: DataTableProps<T>) => {
@@ -27,6 +27,7 @@ export const DataTable = <T,>({
2727
<TableHead
2828
key={columnIndex}
2929
className={cn(
30+
'bg-dark-400 text-purple-100 py-4',
3031
headerCellClassName,
3132
column.headClassName,
3233
columnIndex === 0 && 'pl-5',
@@ -43,14 +44,15 @@ export const DataTable = <T,>({
4344
<TableRow
4445
key={rowKey(row, rowIndex)}
4546
className={cn(
46-
'overflow-hidden rounded-lg border-b border-purple-100/5 hover:bg-dark-400/30!',
47+
'overflow-hidden rounded-lg border-b border-purple-100/5 hover:bg-dark-400/30! relative',
4748
bodyRowClassName
4849
)}
4950
>
5051
{columns.map((column, columnIndex) => (
5152
<TableCell
5253
key={columnIndex}
5354
className={cn(
55+
'py-4',
5456
bodyCellClassName,
5557
column.cellClassName,
5658
columnIndex === 0 && 'pl-5',

components/LiveDataWrapper.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,6 @@ export default function LiveDataWrapper({
9393
columns={tradeColumns}
9494
data={trades ?? []}
9595
rowKey={(_, index) => index}
96-
headerCellClassName='py-4! bg-dark-400 text-purple-100'
97-
bodyCellClassName='py-4!'
9896
/>
9997
</div>
10098

components/home/Categories.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ export const Categories = async () => {
7070
columns={columns}
7171
data={categories}
7272
rowKey={(_, index) => index}
73-
headerCellClassName='py-3! bg-dark-400 text-purple-100'
74-
bodyCellClassName='py-2!'
7573
/>
7674
</div>
7775
);

components/home/TrendingCoins.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const TrendingCoins = async () => {
6666
columns={columns}
6767
data={trendingCoins.slice(0, 6)}
6868
rowKey={(_, index) => index}
69-
headerCellClassName='py-3! bg-dark-400 text-purple-100'
69+
headerCellClassName='py-3!'
7070
bodyCellClassName='py-2!'
7171
/>
7272
</div>

0 commit comments

Comments
 (0)