알림목록 종목별 정렬시 시간별로 정렬되도록 수정

This commit is contained in:
Macbook
2026-06-03 11:33:18 +09:00
parent 5ced979212
commit c228f18c25
5 changed files with 92 additions and 27 deletions
@@ -1,5 +1,6 @@
import React from 'react';
import React, { useMemo } from 'react';
import type { PaperTradeDto } from '../../lib/shared';
import { compareTimeAsc } from '@frontend/utils/tradeListSort';
import MobileStackHeader from '../../components/MobileStackHeader';
interface Props {
@@ -9,7 +10,13 @@ interface Props {
}
export default function VirtualHistoryScreen({ market, trades, onBack }: Props) {
const filtered = trades.filter(t => t.symbol === market).slice(0, 50);
const filtered = useMemo(
() => trades
.filter(t => t.symbol === market)
.sort((a, b) => compareTimeAsc(a.createdAt, b.createdAt))
.slice(0, 50),
[trades, market],
);
return (
<div className="screen stack-screen">