Skip to content

Commit b9171ae

Browse files
committed
๐Ÿšง ๋ชจ๋…ธ๋ ˆํฌ๋กœ ๋ณ€๊ฒฝํ•˜๊ธฐ์ „ ์ปค๋ฐ‹
์—๋””ํ„ฐ ๋กœ์ง๊ณผ ์œ ์ €์˜ ์‚ฌ์ดํŠธ๋ฅผ ๋ฐฐํฌํ•ด์ฃผ๋Š” use-template๋กœ์ง์„ ๋ถ„๋ฆฌ๋œ ํ”„๋กœ์ ํŠธ๋กœ ๊ตฌ์„ฑํ•˜๊ธฐ ์œ„ํ•œ ์ž‘์—…์ž„. ํ˜„์žฌ๋Š” ๋‹จ์ผ ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ์ง€๋งŒ ๋ชจ๋…ธ๋ ˆํฌ๋กœ ๋ณ€๊ฒฝํ•  ์˜ˆ์ •
1 parent 9ac78fa commit b9171ae

File tree

12 files changed

+64
-5
lines changed

12 files changed

+64
-5
lines changed

src/core/editor/components/heading.tsx renamed to src/packages/editor/components/heading.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NodeComponentProps } from "@editor/types/component";
1+
import { NodeComponentProps } from "@/packages/editor/types/component";
22
import { HeadingNode } from "../types/nodes";
33
import applyStyles from "../nodeRenerder/applyStyles";
44

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { useBuilderMode } from "@/providers/builderProvider";
2+
import applyStyles from "../nodeRenerder/applyStyles";
3+
import { NodeComponentProps } from "../types/component";
4+
import { HeroNode } from "../types/nodes";
5+
6+
export default function HeroComponent({
7+
node,
8+
props,
9+
style,
10+
}: NodeComponentProps<HeroNode>) {
11+
const { mode } = useBuilderMode(); //ํ˜„์žฌ ๋ชจ๋“œ ํ™•์ธ
12+
const { heading, subHeading, button, backgroundImage } = props;
13+
const inlineStyles = applyStyles(style);
14+
const bgImageUrl = backgroundImage ? backgroundImage : null;
15+
16+
const handleLinkClick = (e: React.MouseEvent) => {
17+
if (mode === "editor") e.preventDefault();
18+
};
19+
20+
return (
21+
<div>
22+
<h1>{heading}</h1>
23+
{subHeading && <p>{subHeading}</p>}
24+
{button && (
25+
<a
26+
href={button && button.link}
27+
style={inlineStyles}
28+
onClick={handleLinkClick}
29+
></a>
30+
)}
31+
</div>
32+
);
33+
}
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as componentProps from "@/core/editor/types/componentProps";
1+
import * as componentProps from "@/packages/editor/types/componentProps";
22
import { NodeStyle } from "./styles";
33

44
//๋…ธ๋“œ์˜ ํƒ€์ž…๋ณ„๋กœ Props์˜ Json๊ตฌ์กฐ๊ฐ€ ๋‹ฌ๋ผ์ง„๋‹ค. ์ด๋ฅผ ์ถ”๋ก ํ•˜๊ธฐ ์œ„ํ•ด ๊ธฐ๋ณธ ๋…ธ๋“œ ํƒ€์ž…์ธ BaseNode๋ฅผ ์ƒ์†๋ฐ›์•„

โ€Žsrc/packages/index.tsxโ€Ž

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@repo/ui",
3+
"version": "0.0.0",
4+
"exports": {
5+
"./renderer": "./src/renderer/NodeRenderer.tsx"
6+
},
7+
"dependencies": {
8+
"react": "19.1.0",
9+
"next": "15.5.6"
10+
}
11+
}

0 commit comments

Comments
ย (0)