Skip to content

Commit 1c70c6e

Browse files
committed
Feat: Add template
1 parent eaa3c95 commit 1c70c6e

1 file changed

Lines changed: 36 additions & 1 deletion

File tree

frontend/components/pages/CreateItemPage/CreateItemPage.js

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,33 @@ import Editor from "_molecules/Editor";
2020
import ItemListHeader from "_molecules/ItemListHeader";
2121
import { attemptCreateItem } from "_thunks/item";
2222

23+
const template = [
24+
{
25+
title: "순서가 있는 업무",
26+
content:
27+
"<h1>1. 첫번째 업무 제목</h1><p>첫번째 업무에 대한 설명을 자세히 적어주세요.</p><h1>2. 두번째 업무 제목</h1><p>두번째 업무에 대한 설명을 자세히 적어주세요.</p><h1>3. 세번째 업무 제목</h1><p>세번째 업무에 대한 설명을 자세히 적어주세요.</p>",
28+
},
29+
{
30+
title: "시간대별로 수행하는 업무",
31+
content:
32+
"<h1>09:00 업무 제목</h1><p>09:00 에 하는 업무에 대한 설명을 자세히 적어주세요.</p><h1>10:00 업무 제목</h1><p>10:00 에 하는 업무에 대한 설명을 자세히 적어주세요.</p><h1>11:00 업무 제목</h1><p>11:00 에 하는 업무에 대한 설명을 자세히 적어주세요.</p>",
33+
},
34+
{
35+
title: "상황에 따라 하는 업무",
36+
content:
37+
"<h1>상황: 상황 제목</h1><p>아래 업무는 이러이러한 상황이 일어났을때 수행한다.</p><p>상황에 대한 설명을 자세히 적어주세요.</p><h1>업무: 수행해야 할 업무 제목</h1><p>수행해야 할 업무에 대한 설명을 자세히 적어주세요.</p>",
38+
},
39+
{
40+
title: "부대시설 이용",
41+
content:
42+
"<h1>부대시설 이름</h1><p>부대시설에 대한 설명을 간단하게 적어주세요.</p><h2>사용 시간</h2><p>부대시설을 사용할 수 있는 시간을 적어주세요.</p><ul><li><p><strong>평일</strong>: 09:00 ~ 17:00</p></li><li><p><strong>주말</strong>: 11:00 ~ 15:00</p></li></ul><h2>사용 방법</h2><p>부대시설을 사용하는 방법을 자세히 적어주세요.</p><h2>주의 사항</h2><p>부대시설을 사용할 때 주의해야 할 사항을 자세히 적어주세요.</p>",
43+
},
44+
{
45+
title: "내용 초기화",
46+
content: "",
47+
},
48+
];
49+
2350
export default function CreateItemPage() {
2451
// find current user from store
2552
const { user } = useSelector(R.pick(["user"]));
@@ -48,7 +75,7 @@ export default function CreateItemPage() {
4875
let item = {
4976
title: title,
5077
content: content,
51-
status: "published"
78+
status: "published",
5279
};
5380

5481
if (parentPath !== "new") {
@@ -106,6 +133,14 @@ export default function CreateItemPage() {
106133
</div>
107134
</Stack>
108135

136+
<div style={{ display: "flex", flexDirection: "row", gap: 8 }}>
137+
{template.map((e, i) => (
138+
<Button variant="outlined" onClick={() => setInitialContent(e.content)}>
139+
<div className="item-title">{e.title}</div>
140+
</Button>
141+
))}
142+
</div>
143+
109144
{/* Item content editor */}
110145
<Editor
111146
className="item-page-content-editor"

0 commit comments

Comments
 (0)