diff --git a/src/pages/trade/ui/summary.tsx b/src/pages/trade/ui/summary.tsx index a3353fb..0f67dc6 100644 --- a/src/pages/trade/ui/summary.tsx +++ b/src/pages/trade/ui/summary.tsx @@ -1,5 +1,4 @@ import { ReactNode } from 'react'; -import cn from 'clsx'; import { useAutoAnimate } from '@formkit/auto-animate/react'; import { Text } from '@penumbra-zone/ui/Text'; import { Skeleton } from '@/shared/ui/skeleton'; @@ -64,24 +63,16 @@ export const Summary = () => { - {data && 'noData' in data && ( + {data && 'change' in data ? ( + + {getTextSign(data)} + {data.change.percent}% + + ) : ( - )} - {data && 'change' in data && ( -
- {round({ value: data.change.value, decimals: 6 })} - - - {getTextSign(data)} - {data.change.percent}% - - -
- )}
@@ -123,12 +114,12 @@ const getTextSign = (res: SummaryDataResponse) => { return ''; }; -const getColor = (res: SummaryDataResponse, isBg = false): string => { +const getColor = (res: SummaryDataResponse) => { if (res.change.sign === 'positive') { - return isBg ? 'bg-success-light' : 'text-success-light'; + return 'success.light'; } if (res.change.sign === 'negative') { - return isBg ? 'bg-destructive-light' : 'text-destructive-light'; + return 'destructive.light'; } - return isBg ? 'bg-neutral-light' : 'text-neutral-light'; + return 'neutral.light'; }; diff --git a/src/shared/api/server/summary.ts b/src/shared/api/server/summary.ts index b0c9130..3ea0109 100644 --- a/src/shared/api/server/summary.ts +++ b/src/shared/api/server/summary.ts @@ -62,7 +62,6 @@ export async function GET(req: NextRequest): Promise