환율 위젯과 날씨 위젯

This commit is contained in:
leeheejin
2025-10-14 10:05:40 +09:00
parent 26649b78f3
commit dac3e927aa
3 changed files with 270 additions and 115 deletions

View File

@@ -70,6 +70,11 @@ export function CanvasElement({
return;
}
// 위젯 내부 (헤더 제외) 클릭 시 드래그 무시 - 인터랙티브 사용 가능
if ((e.target as HTMLElement).closest(".widget-interactive-area")) {
return;
}
onSelect(element.id);
setIsDragging(true);
setDragStart({
@@ -344,12 +349,12 @@ export function CanvasElement({
</div>
) : element.type === "widget" && element.subtype === "weather" ? (
// 날씨 위젯 렌더링
<div className="h-full w-full">
<div className="h-full w-full widget-interactive-area">
<WeatherWidget city={element.config?.city || "서울"} refreshInterval={600000} />
</div>
) : element.type === "widget" && element.subtype === "exchange" ? (
// 환율 위젯 렌더링
<div className="h-full w-full">
<div className="h-full w-full widget-interactive-area">
<ExchangeWidget
baseCurrency={element.config?.baseCurrency || "KRW"}
targetCurrency={element.config?.targetCurrency || "USD"}