@@ -95,66 +95,66 @@ export const EditorActions = ({ control }: EditorActionsProps) => {
95
95
96
96
return (
97
97
< div className = "flex flex-wrap md:flex-nowrap min-h-[calc(100vh-6rem)]" >
98
- < div className = "flex flex-col w-full h-[calc(100vh-6rem)] m-4.5 md:w-1/2 md:mr-8 pb-8 overflow-auto " >
99
- < div >
100
- < EditorActionAdd
101
- control = { control }
102
- action = { editingAction }
103
- onSubmit = { onSubmit }
104
- onCancel = { ( ) => setEditingAction ( undefined ) }
105
- />
106
- </ div >
98
+ < div className = "md:w-1/2 md:mr-8 w-full" >
99
+ < EditorActionAdd
100
+ control = { control }
101
+ action = { editingAction }
102
+ onSubmit = { onSubmit }
103
+ onCancel = { ( ) => setEditingAction ( undefined ) }
104
+ />
107
105
</ div >
108
106
109
- < div className = "p-2 -mx-2 w-full h-[calc(100vh-6rem)] md:w-1/2 pb-8 overflow-auto" >
110
- < DndContext
111
- sensors = { sensors }
112
- onDragStart = { handleDragStart }
113
- onDragOver = { handleDragOver }
114
- onDragEnd = { handleDragEnd }
115
- onDragCancel = { handleDragEnd }
116
- >
117
- < SortableContext
118
- items = { actions . map ( getId ) }
119
- strategy = { verticalListSortingStrategy }
107
+ < div className = " md:w-1/2 w-full" >
108
+ < div className = "overflow-auto h-[calc(100vh-6rem)] p-2 pt-0 pb-8 -mx-2" >
109
+ < DndContext
110
+ sensors = { sensors }
111
+ onDragStart = { handleDragStart }
112
+ onDragOver = { handleDragOver }
113
+ onDragEnd = { handleDragEnd }
114
+ onDragCancel = { handleDragEnd }
120
115
>
121
- < ul >
122
- { actions . map ( ( action , i ) => (
123
- < li key = { getId ( action ) } className = "mt-2" >
124
- < Sortable id = { getId ( action ) } >
125
- { ( attrs ) => (
126
- < EditorActionItem
127
- action = { action }
128
- editing = { isEditing ( action ) }
129
- onEdit = { ( ) =>
130
- setEditingAction (
131
- isEditing ( action ) ? undefined : action ,
132
- )
133
- }
134
- onDuplicate = { ( ) => handleDuplicate ( i ) }
135
- onRemove = { ( ) => remove ( i ) }
136
- { ...attrs }
137
- />
138
- ) }
139
- </ Sortable >
140
- </ li >
141
- ) ) }
142
- </ ul >
143
- </ SortableContext >
144
-
145
- < DragOverlay >
146
- { draggingAction && (
147
- < EditorActionItem
148
- editing = { isEditing ( draggingAction ) }
149
- action = { draggingAction }
150
- />
151
- ) }
152
- </ DragOverlay >
153
- </ DndContext >
154
-
155
- { actions . length === 0 && (
156
- < NonIdealState title = "暂无动作" className = "my-4" icon = "inbox" />
157
- ) }
116
+ < SortableContext
117
+ items = { actions . map ( getId ) }
118
+ strategy = { verticalListSortingStrategy }
119
+ >
120
+ < ul >
121
+ { actions . map ( ( action , i ) => (
122
+ < li key = { getId ( action ) } className = "mt-2" >
123
+ < Sortable id = { getId ( action ) } >
124
+ { ( attrs ) => (
125
+ < EditorActionItem
126
+ action = { action }
127
+ editing = { isEditing ( action ) }
128
+ onEdit = { ( ) =>
129
+ setEditingAction (
130
+ isEditing ( action ) ? undefined : action ,
131
+ )
132
+ }
133
+ onDuplicate = { ( ) => handleDuplicate ( i ) }
134
+ onRemove = { ( ) => remove ( i ) }
135
+ { ...attrs }
136
+ />
137
+ ) }
138
+ </ Sortable >
139
+ </ li >
140
+ ) ) }
141
+ </ ul >
142
+ </ SortableContext >
143
+
144
+ < DragOverlay >
145
+ { draggingAction && (
146
+ < EditorActionItem
147
+ editing = { isEditing ( draggingAction ) }
148
+ action = { draggingAction }
149
+ />
150
+ ) }
151
+ </ DragOverlay >
152
+ </ DndContext >
153
+
154
+ { actions . length === 0 && (
155
+ < NonIdealState title = "暂无动作" className = "my-4" icon = "inbox" />
156
+ ) }
157
+ </ div >
158
158
</ div >
159
159
</ div >
160
160
)
0 commit comments