1- import { NodeComponentProps } from "../types/component" ;
2- import { HeroNode } from "../types/nodes" ;
31import { useBuilderMode } from "context/builderMode" ;
42import Image from "next/image" ;
5- import processNodeStyles from "../utils/style" ;
3+ import processNodeStyles from "../utils/processNodeStyles" ;
4+ import { HeroNode , NodeComponentProps } from "types" ;
65
76export default function HeroComponent ( {
87 node,
@@ -29,12 +28,20 @@ export default function HeroComponent({
2928 //TODO - 노드들이 드래그 앤 드롭될때 위치가 자유롭게 변하게 할 수 있어야한다.
3029 < section
3130 data-component-id = { node . id }
32- className = { `${ style . className } flex h-full w-full flex-col items-center justify-center gap-2 overflow-hidden` }
33- style = { nodeStyleObj . root }
31+ className = { `${ style . root ?. className || "" } flex h-full w-full flex-col items-center justify-center gap-2 overflow-hidden` }
32+ style = { {
33+ ...nodeStyleObj . root ,
34+ // ⚠️ 안전 장치: style 객체에 크기 정보가 있어도 무시하고 강제로 100%로 덮어씁니다.
35+ width : "100%" ,
36+ height : "100%" ,
37+ } }
3438 >
3539 { /* 배경 이미지 영역 */ }
3640 { image ?. url && (
37- < div className = { `absolute inset-0 z-0` } style = { nodeStyleObj . image } >
41+ < div
42+ className = { `${ style . image ?. className || "" } absolute inset-0 z-0` }
43+ style = { nodeStyleObj . image }
44+ >
3845 < Image
3946 fill = { true }
4047 className = { "object-cover" }
@@ -51,15 +58,25 @@ export default function HeroComponent({
5158 className = { "relative top-0 left-0 z-10 flex flex-col items-center p-4" }
5259 >
5360 < h1
61+ className = { style . heading ?. className || "" }
5462 style = { nodeStyleObj . heading } // heading 스타일 적용 (폰트 크기, 색상)
5563 >
5664 { heading }
5765 </ h1 >
58- { subHeading && < p style = { nodeStyleObj . subHeading } > { subHeading } </ p > }
66+
67+ { subHeading && (
68+ < p
69+ className = { style . subHeading ?. className || "" }
70+ style = { nodeStyleObj . subHeading }
71+ >
72+ { subHeading }
73+ </ p >
74+ ) }
5975 { button && (
6076 < a
6177 href = { button . link || "#" }
6278 style = { nodeStyleObj . button }
79+ className = { style . button ?. className || "" }
6380 onClick = { handleLinkClick }
6481 //백그라운드 사진 렌더링 필요
6582 >
0 commit comments