Skip to content

Commit a9e6069

Browse files
committed
fixes
1 parent 2c5587d commit a9e6069

File tree

10 files changed

+362
-427
lines changed

10 files changed

+362
-427
lines changed

src/modules/RecoveryDashboard/components/Dashboard.tsx

Lines changed: 0 additions & 68 deletions
This file was deleted.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import type { DashboardCardData } from "../../types";
2+
3+
interface IProps {
4+
card: DashboardCardData;
5+
averageBurnRate: number | null;
6+
totalBurnPercent: number | null;
7+
}
8+
9+
const Card = ({
10+
card,
11+
averageBurnRate,
12+
totalBurnPercent,
13+
}: IProps): JSX.Element => {
14+
return (
15+
<div className="bg-[#101012] backdrop-blur-md border border-[#23252A] rounded-lg p-6 hover:bg-[#23252A] flex flex-col gap-2">
16+
<h3 className="text-[#9798A4] text-base">{card.title}</h3>
17+
18+
<p className="text-white text-[32px] font-bold">
19+
{card.specialType === "averageBurnRate"
20+
? averageBurnRate !== null
21+
? averageBurnRate.toFixed(2) + "%"
22+
: "—"
23+
: card.value}
24+
</p>
25+
26+
{card.subtitle && (
27+
<p className="text-[#9798A4] text-base">{card.subtitle}</p>
28+
)}
29+
30+
{card.specialType === "averageBurnRate" ? (
31+
<p className="text-green-500 text-sm">
32+
{totalBurnPercent !== null &&
33+
totalBurnPercent.toFixed(2) + "% burned across all tokens"}
34+
</p>
35+
) : (
36+
card.change && (
37+
<p
38+
className={`text-sm ${
39+
card.changeType === "positive"
40+
? "text-green-500"
41+
: card.changeType === "negative"
42+
? "text-red-500"
43+
: "text-gray-400"
44+
}`}
45+
>
46+
{card.change}
47+
</p>
48+
)
49+
)}
50+
</div>
51+
);
52+
};
53+
54+
export { Card };
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { Card } from "./Card";
2+
3+
import type { DashboardCardData } from "../../types";
4+
5+
interface IProps {
6+
cards: DashboardCardData[];
7+
averageBurnRate: number | null;
8+
totalBurnPercent: number | null;
9+
}
10+
11+
const Dashboard = ({
12+
cards,
13+
averageBurnRate,
14+
totalBurnPercent,
15+
}: IProps): JSX.Element => {
16+
return (
17+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mt-8">
18+
{cards.map((card, index) => (
19+
<Card
20+
key={index}
21+
card={card}
22+
averageBurnRate={averageBurnRate}
23+
totalBurnPercent={totalBurnPercent}
24+
/>
25+
))}
26+
</div>
27+
);
28+
};
29+
30+
export { Dashboard };

src/modules/RecoveryDashboard/components/PriceCell.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { PriceCellProps } from "../types";
22

3-
export const PriceCell: React.FC<PriceCellProps> = ({ price }) => {
3+
const PriceCell: React.FC<PriceCellProps> = ({ price }) => {
44
if (!price) {
55
return <div className="text-[#97979A] text-sm"></div>;
66
}
@@ -18,3 +18,5 @@ export const PriceCell: React.FC<PriceCellProps> = ({ price }) => {
1818
</div>
1919
);
2020
};
21+
22+
export { PriceCell };

src/modules/RecoveryDashboard/components/TablePagination.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BackwardIcon, ForwardIcon } from "../ui/icons";
1+
import { ArrowIcon } from "@ui";
22

33
interface Props {
44
currentPage: number;
@@ -11,7 +11,7 @@ interface Props {
1111
onItemsPerPageChange: (value: number) => void;
1212
}
1313

14-
export function TablePagination({
14+
const TablePagination = ({
1515
currentPage,
1616
totalPages,
1717
itemsPerPage,
@@ -20,10 +20,9 @@ export function TablePagination({
2020
endIndex,
2121
onPageChange,
2222
onItemsPerPageChange,
23-
}: Props): JSX.Element {
23+
}: Props): JSX.Element => {
2424
return (
2525
<div className="flex items-center justify-between text-sm md:px-6 bg-[#151618] border-t border-[#23252A]">
26-
{/* Left side - Items per page */}
2726
<div className="flex items-center gap-2">
2827
<div className="hidden md:flex items-center gap-2 py-3">
2928
<span className="text-[#97979A]">Items per page:</span>
@@ -44,8 +43,6 @@ export function TablePagination({
4443
items
4544
</span>
4645
</div>
47-
48-
{/* Right side - Navigation */}
4946
<div className="flex items-center gap-2">
5047
<div className="hidden md:flex items-center gap-2">
5148
<button
@@ -72,17 +69,19 @@ export function TablePagination({
7269
disabled={currentPage === 1}
7370
className="border-r border-l border-[#23252a] py-3 px-4 text-white disabled:text-[#97979A] cursor-pointer disabled:cursor-not-allowed"
7471
>
75-
<BackwardIcon className="w-4 h-4 rotate-90" />
72+
<ArrowIcon isActive={currentPage !== 1} rotate={90} />
7673
</button>
7774
<button
7875
onClick={() => onPageChange(Math.min(currentPage + 1, totalPages))}
7976
disabled={currentPage === totalPages}
8077
className="py-3 pr-4 text-white disabled:text-[#97979A] cursor-pointer disabled:cursor-not-allowed"
8178
>
82-
<ForwardIcon className="w-4 h-4 rotate-270" />
79+
<ArrowIcon isActive={currentPage !== totalPages} rotate={270} />
8380
</button>
8481
</div>
8582
</div>
8683
</div>
8784
);
88-
}
85+
};
86+
87+
export { TablePagination };
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { Dashboard } from "./Dashboard";
2+
import { PriceCell } from "./PriceCell";
3+
import { TablePagination } from "./TablePagination";
4+
5+
export { Dashboard, PriceCell, TablePagination };

src/modules/RecoveryDashboard/constants/data.ts renamed to src/modules/RecoveryDashboard/constants/index.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
// src/modules/RecoveryDashboard/constants/data.ts
2-
import { Column, DashboardCardData } from "../types";
1+
import type { Column, DashboardCardData } from "../types";
32

4-
export const tokenColumns: Column[] = [
3+
const tokenColumns: Column[] = [
54
{ label: "Token", sortable: true },
65
{ label: "Token Address", sortable: false },
76
{ label: "Recovery Progress", sortable: true },
87
];
98

10-
export const tokenData = [
9+
const tokenData = [
1110
{
1211
name: "Recovery Stability USD",
1312
symbol: "RECmetaUSD",
@@ -52,13 +51,13 @@ export const tokenData = [
5251
},
5352
];
5453

55-
export const poolColumns: Column[] = [
54+
const poolColumns: Column[] = [
5655
{ label: "Pair", sortable: true },
5756
{ label: "Pool Address", sortable: false },
5857
{ label: "Price", sortable: true },
5958
];
6059

61-
export const poolData = [
60+
const poolData = [
6261
{
6362
name: "Shadow RECmetaUSD/wmetaUSD",
6463
url: "https://www.shadow.so/liquidity/manage/0x1e2edba99efd08578460bd9a66f4f521ec861eb9",
@@ -97,7 +96,7 @@ export const poolData = [
9796
},
9897
];
9998

100-
export const dashboardData: DashboardCardData[] = [
99+
const dashboardData: DashboardCardData[] = [
101100
{
102101
title: "Total Tokens",
103102
value: tokenData.length,
@@ -117,3 +116,5 @@ export const dashboardData: DashboardCardData[] = [
117116
specialType: null,
118117
},
119118
];
119+
120+
export { tokenColumns, tokenData, poolColumns, poolData, dashboardData };

0 commit comments

Comments
 (0)