실시간 차트 갱신시 화면떨림 문제 해결

This commit is contained in:
Macbook
2026-05-27 14:54:50 +09:00
parent f7aac535d8
commit 7a0af36b9b
10 changed files with 517 additions and 130 deletions
+9 -1
View File
@@ -9,6 +9,8 @@ interface IndicatorModalProps {
activeIndicators: IndicatorConfig[];
onAdd: (def: IndicatorDef, params: Record<string, number | string | boolean>) => void;
onRemove: (id: string) => void;
/** type 단위 일괄 제거 (여러 인스턴스를 한 번에 제거) */
onRemoveByType?: (type: string) => void;
onClose: () => void;
}
@@ -17,7 +19,9 @@ const CATEGORIES: IndicatorCategory[] = [
'Trend', 'Volatility', 'Volume', 'Candlestick Patterns',
];
const IndicatorModal: React.FC<IndicatorModalProps> = ({ activeIndicators, onAdd, onRemove, onClose }) => {
const IndicatorModal: React.FC<IndicatorModalProps> = ({
activeIndicators, onAdd, onRemove, onRemoveByType, onClose,
}) => {
const [search, setSearch] = useState('');
const [category, setCategory] = useState<IndicatorCategory | 'All'>('All');
const [selected, setSelected] = useState<IndicatorDef | null>(null);
@@ -45,6 +49,10 @@ const IndicatorModal: React.FC<IndicatorModalProps> = ({ activeIndicators, onAdd
};
const handleRemoveAll = (type: string) => {
if (onRemoveByType) {
onRemoveByType(type);
return;
}
activeIndicators.filter(a => a.type === type).forEach(a => onRemove(a.id));
};