Files
page-builder/src/app/editor/templates/footerTemplate.ts
T
jaybe 546c961a31
CI / test (push) Failing after 6m10s
CI / pr_and_merge (push) Has been skipped
섹션 레이아웃 및 템플릿 스타일 개선
2025-11-21 16:25:55 +09:00

68 lines
1.6 KiB
TypeScript

"use client";
import type { Block, SectionBlockProps, TextBlockProps } from "@/features/editor/state/editorStore";
export function createFooterTemplateBlocks(opts: {
sectionId: string;
createId: () => string;
}): { blocks: Block[]; lastSelectedId: string } {
const { sectionId, createId } = opts;
const columns: SectionBlockProps["columns"] = [
{ id: `${sectionId}_col_1`, span: 12 },
];
const sectionProps: SectionBlockProps = {
background: "muted",
paddingY: "md",
// 푸터는 상대적으로 낮은 높이와 좁은 최대 폭을 사용한다.
paddingYPx: 40,
maxWidthPx: 800,
backgroundColorCustom: "#020617",
columns,
} as any;
const sectionBlock: Block = {
id: sectionId,
type: "section",
props: sectionProps,
sectionId: null,
columnId: null,
};
const firstColumnId = `${sectionId}_col_1`;
const linksId = createId();
const linksProps: TextBlockProps = {
text: "이용약관 · 개인정보처리방침",
align: "center",
size: "sm",
} as any;
const linksBlock: Block = {
id: linksId,
type: "text",
props: linksProps,
sectionId,
columnId: firstColumnId,
};
const copyrightId = createId();
const copyrightProps: TextBlockProps = {
text: "© 2025 MyLanding. All rights reserved.",
align: "center",
size: "sm",
} as any;
const copyrightBlock: Block = {
id: copyrightId,
type: "text",
props: copyrightProps,
sectionId,
columnId: firstColumnId,
};
const blocks: Block[] = [sectionBlock, linksBlock, copyrightBlock];
const lastSelectedId = copyrightId;
return { blocks, lastSelectedId };
}