Skip to content

Commit 0e3e51c

Browse files
committed
🐛 CI 에서 잡힌 타입에러 수정
1 parent a8e4986 commit 0e3e51c

File tree

8 files changed

+51
-17
lines changed

8 files changed

+51
-17
lines changed
Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
import { create } from 'zustand';
22

3-
export const useModalStore = create((set) => ({
4-
modals: [
5-
{ id: 'm1', name: '로그인 팝업' },
6-
{ id: 'm2', name: '공지사항' },
7-
],
8-
activeModalId: null,
9-
selectModal: (id: string) => set({ activeModalId: id }),
10-
createModal: () => alert('새 모달 생성 모드 진입'),
11-
}));
3+
interface Modal {
4+
id: string;
5+
name: string;
6+
}
7+
8+
interface ModalState {
9+
modals: Modal[];
10+
activeModalId: string | null;
11+
selectModal: (id: string) => void;
12+
createModal: () => void;
13+
}
14+
15+
export const useModalStore = create<ModalState>((set) => ({
16+
modals: [
17+
{ id: 'm1', name: '로그인 팝업' },
18+
{ id: 'm2', name: '공지사항' },
19+
],
20+
activeModalId: null,
21+
selectModal: (id: string) => set({ activeModalId: id }),
22+
createModal: () => alert('새 모달 생성 모드 진입'),
23+
}));

apps/editor/src/entities/page/model/store.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import { create } from 'zustand';
22

3-
export const usePageStore = create((set) => ({
3+
interface Page {
4+
id: string;
5+
name: string;
6+
}
7+
8+
interface PageState {
9+
pages: Page[];
10+
activePageId: string;
11+
selectPage: (id: string) => void;
12+
}
13+
14+
export const usePageStore = create<PageState>((set) => ({
415
pages: [
516
{ id: '1', name: '메인 페이지' },
617
{ id: '2', name: '상품 상세' },

apps/editor/src/entities/section/model/store.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import { create } from 'zustand';
22

3-
export const useSectionStore = create((set) => ({
3+
interface Section {
4+
id: string;
5+
name: string;
6+
}
7+
8+
interface SectionState {
9+
sections: Section[];
10+
selectSection: (id: string) => void;
11+
}
12+
13+
export const useSectionStore = create<SectionState>((set) => ({
414
sections: [
515
{ id: 's1', name: '히어로 섹션' },
616
{ id: 's2', name: '특징 소개' },

apps/editor/src/shared/lib/component-defaults.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { NodeStyle } from "@repo/ui/types/styles";
55
// ComponentDefault Data Type
66
// 추천 코드를 반영하여 layout 필드를 분리하고 타입 안정성을 강화했습니다.
77
export interface ComponentDefaults {
8-
props: any; // 각 노드 타입에 맞는 props (통합 노드 타입에서 추론)
8+
props: Record<string, unknown>; // 각 노드 타입에 맞는 props (통합 노드 타입에서 추론)
99
style: NodeStyle; // @repo/ui의 규격화된 스타일 구조 (root 등)
1010
layout: WcxNode['layout']; // x, y, width, height, zIndex
1111
}

apps/editor/src/widgets/left-sidebar/ui/sub-panels/ComponentPanel.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { StaticContent } from './base/StaticContent';
33
import { STATIC_PANEL_DATA } from '../../model/constants';
44

55
import { useCreateCanvasNode } from '../../../../features/canvas/model/useCreateCanvasNode';
6+
import type { WcxNode } from '@repo/ui/types/nodes';
67

78
export const ComponentPanel = () => {
89
const { title, description, items } = STATIC_PANEL_DATA.component;
@@ -13,14 +14,14 @@ export const ComponentPanel = () => {
1314
// TODO: 프로젝트 전역에서 사용할 수 있는 전용 핸들러(Feature)로 이 로직을 추출할지 검토
1415
createNode({
1516
pageId: 201,
16-
type: item.id as any // TODO: STATIC_PANEL_DATA의 타입을 WcxNode['type']과 매핑하여 타입 단언 제거 필요
17+
type: item.id as WcxNode['type'] // TODO: STATIC_PANEL_DATA의 타입을 WcxNode['type']과 매핑하여 타입 단언 제거 필요
1718
});
1819
};
1920

2021
return (
2122
<PanelBaseLayout title={title} description={description}>
2223
<StaticContent
23-
items={items as any}
24+
items={items}
2425
onItemClick={handleComponentClick}
2526
/>
2627
</PanelBaseLayout>

apps/editor/src/widgets/left-sidebar/ui/sub-panels/ModalPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DynamicContent } from './base/DynamicContent';
33
import { useModalStore } from '@/entities/modal';
44

55
export const ModalPanel = () => {
6-
const { modals, selectModal, createModal }: any = useModalStore();
6+
const { modals, selectModal, createModal } = useModalStore();
77

88
return (
99
<PanelBaseLayout title="모달" description="목록">

apps/editor/src/widgets/left-sidebar/ui/sub-panels/PagePanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DynamicContent } from './base/DynamicContent';
33
import { usePageStore } from '@/entities/page'; // 예시 엔티티 참조
44

55
export const PagePanel = () => {
6-
const { pages, activePageId, selectPage }: any = usePageStore();
6+
const { pages, activePageId, selectPage } = usePageStore();
77

88
return (
99
<PanelBaseLayout title="페이지" description="목록">

apps/editor/src/widgets/left-sidebar/ui/sub-panels/SectionPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { DynamicContent } from './base/DynamicContent';
33
import { useSectionStore } from '@/entities/section';
44

55
export const SectionPanel = () => {
6-
const { sections, selectSection }: any = useSectionStore();
6+
const { sections, selectSection } = useSectionStore();
77

88
return (
99
<PanelBaseLayout title="섹션" description="페이지 이름">

0 commit comments

Comments
 (0)