@@ -137,71 +137,38 @@ const ResponsiveLayout = (props: ResponsiveLayoutProps) => {
137
137
wrap = { rowBreak }
138
138
gutter = { [ horizontalSpacing , verticalSpacing ] }
139
139
>
140
- { columns . map ( ( column ) => {
140
+ { columns . map ( column => {
141
141
const id = String ( column . id ) ;
142
- const childDispatch = wrapDispatch (
143
- wrapDispatch ( dispatch , 'containers' ) ,
144
- id
145
- ) ;
146
- if ( ! containers [ id ] ) return null ;
142
+ const childDispatch = wrapDispatch ( wrapDispatch ( dispatch , "containers" ) , id ) ;
143
+ if ( ! containers [ id ] ) return null
147
144
const containerProps = containers [ id ] . children ;
148
145
149
146
const columnCustomStyle = {
150
- margin : ! _ . isEmpty ( column . margin )
151
- ? column . margin
152
- : columnStyle . margin ,
153
- padding : ! _ . isEmpty ( column . padding )
154
- ? column . padding
155
- : columnStyle . padding ,
156
- radius : ! _ . isEmpty ( column . radius )
157
- ? column . radius
158
- : columnStyle . radius ,
147
+ margin : ! _ . isEmpty ( column . margin ) ? column . margin : columnStyle . margin ,
148
+ padding : ! _ . isEmpty ( column . padding ) ? column . padding : columnStyle . padding ,
149
+ radius : ! _ . isEmpty ( column . radius ) ? column . radius : columnStyle . radius ,
159
150
border : `1px solid ${ ! _ . isEmpty ( column . border ) ? column . border : columnStyle . border } ` ,
160
- background : ! _ . isEmpty ( column . background )
161
- ? column . background
162
- : columnStyle . background ,
163
- } ;
151
+ background : ! _ . isEmpty ( column . background ) ? column . background : columnStyle . background ,
152
+ }
164
153
const noOfColumns = columns . length ;
165
154
let backgroundStyle = columnCustomStyle . background ;
166
- if ( ! _ . isEmpty ( column . backgroundImage ) ) {
155
+ if ( ! _ . isEmpty ( column . backgroundImage ) ) {
167
156
backgroundStyle = `center / cover url('${ column . backgroundImage } ') no-repeat, ${ backgroundStyle } ` ;
168
157
}
169
158
return (
170
159
< ColWrapper
171
160
key = { id }
172
- lg = {
173
- 24 /
174
- ( noOfColumns < columnPerRowLG
175
- ? noOfColumns
176
- : columnPerRowLG )
177
- }
178
- md = {
179
- 24 /
180
- ( noOfColumns < columnPerRowMD
181
- ? noOfColumns
182
- : columnPerRowMD )
183
- }
184
- sm = {
185
- 24 /
186
- ( noOfColumns < columnPerRowSM
187
- ? noOfColumns
188
- : columnPerRowSM )
189
- }
190
- xs = {
191
- 24 /
192
- ( noOfColumns < columnPerRowSM
193
- ? noOfColumns
194
- : columnPerRowSM )
195
- }
161
+ lg = { 24 / ( noOfColumns < columnPerRowLG ? noOfColumns : columnPerRowLG ) }
162
+ md = { 24 / ( noOfColumns < columnPerRowMD ? noOfColumns : columnPerRowMD ) }
163
+ sm = { 24 / ( noOfColumns < columnPerRowSM ? noOfColumns : columnPerRowSM ) }
164
+ xs = { 24 / ( noOfColumns < columnPerRowSM ? noOfColumns : columnPerRowSM ) }
196
165
$style = { columnCustomStyle }
197
166
$minWidth = { column . minWidth }
198
167
$matchColumnsHeight = { matchColumnsHeight }
199
168
>
200
169
< ColumnContainer
201
170
layout = { containerProps . layout . getView ( ) }
202
- items = { gridItemCompToGridItems (
203
- containerProps . items . getView ( )
204
- ) }
171
+ items = { gridItemCompToGridItems ( containerProps . items . getView ( ) ) }
205
172
positionParams = { containerProps . positionParams . getView ( ) }
206
173
dispatch = { childDispatch }
207
174
autoHeight = { props . autoHeight }
@@ -211,11 +178,12 @@ const ResponsiveLayout = (props: ResponsiveLayoutProps) => {
211
178
} }
212
179
/>
213
180
</ ColWrapper >
214
- ) ;
215
- } ) }
181
+ )
182
+ } )
183
+ }
216
184
</ RowWrapper >
217
185
</ div >
218
- </ DisabledContext . Provider >
186
+ </ DisabledContext . Provider >
219
187
</ BackgroundColorContext . Provider >
220
188
) ;
221
189
} ;
@@ -231,72 +199,67 @@ export const ResponsiveLayoutBaseComp = (function () {
231
199
< >
232
200
< Section name = { sectionNames . basic } >
233
201
{ children . columns . propertyView ( {
234
- title : trans ( ' responsiveLayout.column' ) ,
235
- newOptionLabel : ' Column' ,
202
+ title : trans ( " responsiveLayout.column" ) ,
203
+ newOptionLabel : " Column" ,
236
204
} ) }
237
205
</ Section >
238
206
239
- { ( useContext ( EditorContext ) . editorModeStatus === 'logic' ||
240
- useContext ( EditorContext ) . editorModeStatus === 'both' ) && (
207
+ { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
241
208
< Section name = { sectionNames . interaction } >
242
209
{ disabledPropertyView ( children ) }
243
210
{ hiddenPropertyView ( children ) }
244
211
</ Section >
245
212
) }
246
213
247
- { [ 'layout' , 'both' ] . includes (
248
- useContext ( EditorContext ) . editorModeStatus
249
- ) && (
214
+ { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
250
215
< >
251
216
< Section name = { sectionNames . layout } >
252
- { children . autoHeight . getPropertyView ( ) }
253
- </ Section >
254
- < Section name = { trans ( 'responsiveLayout.rowLayout' ) } >
255
- { children . rowBreak . propertyView ( {
256
- label : trans ( 'responsiveLayout.rowBreak' ) ,
257
- } ) }
258
- { controlItem (
259
- { } ,
260
- < div style = { { marginTop : '8px' } } >
261
- { trans ( 'responsiveLayout.columnsPerRow' ) }
262
- </ div >
263
- ) }
264
- { children . columnPerRowLG . propertyView ( {
265
- label : trans ( 'responsiveLayout.desktop' ) ,
266
- } ) }
267
- { children . columnPerRowMD . propertyView ( {
268
- label : trans ( 'responsiveLayout.tablet' ) ,
269
- } ) }
270
- { children . columnPerRowSM . propertyView ( {
271
- label : trans ( 'responsiveLayout.mobile' ) ,
272
- } ) }
273
- </ Section >
274
- < Section name = { trans ( 'responsiveLayout.columnsLayout' ) } >
275
- { children . matchColumnsHeight . propertyView ( {
276
- label : trans ( 'responsiveLayout.matchColumnsHeight' ) ,
277
- } ) }
278
- { controlItem (
279
- { } ,
280
- < div style = { { marginTop : '8px' } } >
281
- { trans ( 'responsiveLayout.columnsSpacing' ) }
282
- </ div >
283
- ) }
284
- { children . horizontalSpacing . propertyView ( {
285
- label : trans ( 'responsiveLayout.horizontal' ) ,
286
- } ) }
287
- { children . verticalSpacing . propertyView ( {
288
- label : trans ( 'responsiveLayout.vertical' ) ,
289
- } ) }
290
- </ Section >
291
- < Section name = { trans ( 'responsiveLayout.rowStyle' ) } >
292
- { children . rowStyle . getPropertyView ( ) }
293
- </ Section >
294
- < Section name = { trans ( 'responsiveLayout.columnStyle' ) } >
295
- { children . columnStyle . getPropertyView ( ) }
296
- </ Section >
297
- < Section name = { sectionNames . animationStyle } >
217
+ { children . autoHeight . getPropertyView ( ) }
218
+ </ Section >
219
+ < Section name = { trans ( "responsiveLayout.rowLayout" ) } >
220
+ { children . rowBreak . propertyView ( {
221
+ label : trans ( "responsiveLayout.rowBreak" )
222
+ } ) }
223
+ { controlItem ( { } , (
224
+ < div style = { { marginTop : '8px' } } >
225
+ { trans ( "responsiveLayout.columnsPerRow" ) }
226
+ </ div >
227
+ ) ) }
228
+ { children . columnPerRowLG . propertyView ( {
229
+ label : trans ( "responsiveLayout.desktop" )
230
+ } ) }
231
+ { children . columnPerRowMD . propertyView ( {
232
+ label : trans ( "responsiveLayout.tablet" )
233
+ } ) }
234
+ { children . columnPerRowSM . propertyView ( {
235
+ label : trans ( "responsiveLayout.mobile" )
236
+ } ) }
237
+ </ Section >
238
+ < Section name = { trans ( "responsiveLayout.columnsLayout" ) } >
239
+ { children . matchColumnsHeight . propertyView ( {
240
+ label : trans ( "responsiveLayout.matchColumnsHeight" )
241
+ } ) }
242
+ { controlItem ( { } , (
243
+ < div style = { { marginTop : '8px' } } >
244
+ { trans ( "responsiveLayout.columnsSpacing" ) }
245
+ </ div >
246
+ ) ) }
247
+ { children . horizontalSpacing . propertyView ( {
248
+ label : trans ( "responsiveLayout.horizontal" )
249
+ } ) }
250
+ { children . verticalSpacing . propertyView ( {
251
+ label : trans ( "responsiveLayout.vertical" )
252
+ } ) }
253
+ </ Section >
254
+ < Section name = { trans ( "responsiveLayout.rowStyle" ) } >
255
+ { children . rowStyle . getPropertyView ( ) }
256
+ </ Section >
257
+ < Section name = { trans ( "responsiveLayout.columnStyle" ) } >
258
+ { children . columnStyle . getPropertyView ( ) }
259
+ </ Section >
260
+ < Section name = { sectionNames . animationStyle } >
298
261
{ children . animationStyle . getPropertyView ( ) }
299
- </ Section >
262
+ </ Section >
300
263
</ >
301
264
) }
302
265
</ >
0 commit comments