@@ -33,13 +33,7 @@ type SectionEditorPropType = CommonSectionEditorPropType & {
3333 onChange : ( value : SectionType ) => void ;
3434} ;
3535
36- const SectionTextEditor : React . FC < SectionTextEditorPropType > = ( {
37- disabled,
38- defaultValue,
39- onInsertNewSection,
40- onChange,
41- onDelete,
42- } ) => {
36+ const SectionTextEditor : React . FC < SectionTextEditorPropType > = ( { disabled, defaultValue, onInsertNewSection, onChange, onDelete } ) => {
4337 const deleteActionButton = commands . group ( [ ] , {
4438 name : "delete" ,
4539 groupName : "delete" ,
@@ -51,12 +45,7 @@ const SectionTextEditor: React.FC<SectionTextEditorPropType> = ({
5145 return (
5246 < Stack direction = "row" spacing = { 2 } sx = { { width : "100%" , height : "100%" , maxWidth : "100%" } } >
5347 < Stack sx = { { flexGrow : 1 , width : "50%" } } >
54- < Common . Components . MDXEditor
55- disabled = { disabled }
56- defaultValue = { defaultValue }
57- onChange = { onChange }
58- extraCommands = { [ deleteActionButton ] }
59- />
48+ < Common . Components . MDXEditor disabled = { disabled } defaultValue = { defaultValue } onChange = { onChange } extraCommands = { [ deleteActionButton ] } />
6049 < Button size = "small" onClick = { onInsertNewSection } startIcon = { < Add /> } >
6150 여기에 섹션 추가
6251 </ Button >
@@ -70,14 +59,7 @@ const SectionTextEditor: React.FC<SectionTextEditorPropType> = ({
7059 ) ;
7160} ;
7261
73- const SectionEditorField : React . FC < SectionEditorPropType > = ( {
74- language,
75- disabled,
76- defaultValue,
77- onInsertNewSection,
78- onChange,
79- onDelete,
80- } ) => {
62+ const SectionEditorField : React . FC < SectionEditorPropType > = ( { language, disabled, defaultValue, onInsertNewSection, onChange, onDelete } ) => {
8163 const onFieldChange = ( key : "body_ko" | "body_en" , value ?: string ) => onChange ( { ...defaultValue , [ key ] : value } ) ;
8264
8365 return (
@@ -104,21 +86,14 @@ export const AdminCMSPageEditor: React.FC = ErrorBoundary.with(
10486 const { id } = useParams < { id ?: string } > ( ) ;
10587 const { frontendDomain } = Common . Hooks . Common . useCommonContext ( ) ;
10688 const backendAdminClient = Common . Hooks . BackendAdminAPI . useBackendAdminClient ( ) ;
107- const { data : initialSections } = Common . Hooks . BackendAdminAPI . useListPageSectionsQuery (
108- backendAdminClient ,
109- id || ""
110- ) ;
89+ const { data : initialSections } = Common . Hooks . BackendAdminAPI . useListPageSectionsQuery ( backendAdminClient , id || "" ) ;
11190 const [ editorState , setEditorState ] = React . useState < AdminCMSPageEditorStateType > ( {
11291 sections : initialSections ,
11392 tab : 0 ,
11493 } ) ;
115- const bulkUpdateSectionsMutation = Common . Hooks . BackendAdminAPI . useBulkUpdatePageSectionsMutation (
116- backendAdminClient ,
117- id || ""
118- ) ;
94+ const bulkUpdateSectionsMutation = Common . Hooks . BackendAdminAPI . useBulkUpdatePageSectionsMutation ( backendAdminClient , id || "" ) ;
11995
120- const setTab = ( _ : React . SyntheticEvent , selectedTab : number ) =>
121- setEditorState ( ( ps ) => ( { ...ps , tab : selectedTab } ) ) ;
96+ const setTab = ( _ : React . SyntheticEvent , selectedTab : number ) => setEditorState ( ( ps ) => ( { ...ps , tab : selectedTab } ) ) ;
12297
12398 const openOnSiteButton : ButtonProps = {
12499 variant : "outlined" ,
@@ -141,9 +116,7 @@ export const AdminCMSPageEditor: React.FC = ErrorBoundary.with(
141116
142117 const deleteSection = ( index : number ) => ( ) => {
143118 setEditorState ( ( ps ) => {
144- const sections = [ ...( ps . sections || [ ] ) . slice ( 0 , index ) , ...( ps . sections || [ ] ) . slice ( index + 1 ) ] . map (
145- ( s , order ) => ( { ...s , order } )
146- ) ; // Reorder sections
119+ const sections = [ ...( ps . sections || [ ] ) . slice ( 0 , index ) , ...( ps . sections || [ ] ) . slice ( index + 1 ) ] . map ( ( s , order ) => ( { ...s , order } ) ) ; // Reorder sections
147120 return { ...ps , sections } ;
148121 } ) ;
149122 } ;
0 commit comments