From 8788b47663aa0774b179a2a75f8ef0cb14096b38 Mon Sep 17 00:00:00 2001 From: dohyeons Date: Mon, 27 Oct 2025 15:46:13 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=90=EB=9F=AC=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/dashboard/DashboardViewer.tsx | 26 ++++++++++++++----- .../dashboard/widgets/CustomMetricWidget.tsx | 18 ++++++------- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/frontend/components/dashboard/DashboardViewer.tsx b/frontend/components/dashboard/DashboardViewer.tsx index 176acfb0..4ad23fa8 100644 --- a/frontend/components/dashboard/DashboardViewer.tsx +++ b/frontend/components/dashboard/DashboardViewer.tsx @@ -364,6 +364,13 @@ interface ViewerElementProps { * - 태블릿 이하: 세로 스택 카드 레이아웃 */ function ViewerElement({ element, data, isLoading, onRefresh, isMobile, canvasWidth = 1920 }: ViewerElementProps) { + const [isMounted, setIsMounted] = useState(false); + + // 마운트 확인 (Leaflet 지도 초기화 문제 해결) + useEffect(() => { + setIsMounted(true); + }, []); + if (isMobile) { // 태블릿 이하: 세로 스택 카드 스타일 return ( @@ -397,7 +404,11 @@ function ViewerElement({ element, data, isLoading, onRefresh, isMobile, canvasWi )}
- {element.type === "chart" ? ( + {!isMounted ? ( +
+
+
+ ) : element.type === "chart" ? ( ) : ( renderWidget(element) @@ -454,16 +465,17 @@ function ViewerElement({ element, data, isLoading, onRefresh, isMobile, canvasWi
)} -
- {element.type === "chart" ? ( +
+ {!isMounted ? ( +
+
+
+ ) : element.type === "chart" ? ( ) : ( renderWidget(element) diff --git a/frontend/components/dashboard/widgets/CustomMetricWidget.tsx b/frontend/components/dashboard/widgets/CustomMetricWidget.tsx index 0dba9473..52c8411c 100644 --- a/frontend/components/dashboard/widgets/CustomMetricWidget.tsx +++ b/frontend/components/dashboard/widgets/CustomMetricWidget.tsx @@ -374,9 +374,9 @@ export default function CustomMetricWidget({ element }: CustomMetricWidgetProps) } return ( -
+
{/* 콘텐츠 영역 - 스크롤 없이 자동으로 크기 조정 */} -
+
{/* 그룹별 카드 (활성화 시) */} {isGroupByMode && groupedCards.map((card, index) => { @@ -388,10 +388,10 @@ export default function CustomMetricWidget({ element }: CustomMetricWidgetProps) return (
-
{card.label}
-
{card.value.toLocaleString()}
+
{card.label}
+
{card.value.toLocaleString()}
); })} @@ -404,12 +404,12 @@ export default function CustomMetricWidget({ element }: CustomMetricWidgetProps) return (
-
{metric.label}
-
+
{metric.label}
+
{formattedValue} - {metric.unit} + {metric.unit}
);