@@ -18,8 +18,8 @@ import closeIcon from './icon--close.svg';
18
18
import { translateVideo } from '../../lib/libraries/decks/translate-video.js' ;
19
19
import { translateImage } from '../../lib/libraries/decks/translate-image.js' ;
20
20
21
- const CardHeader = ( { onCloseCards, onToggleCards , onShowAll, totalSteps, step, toggle } ) => (
22
- < div className = { toggle ? styles . headerButtons : classNames ( styles . headerButtons , styles . headerButtonsHidden ) } >
21
+ const CardHeader = ( { onCloseCards, onShrinkExpandCards , onShowAll, totalSteps, step, expanded } ) => (
22
+ < div className = { expanded ? styles . headerButtons : classNames ( styles . headerButtons , styles . headerButtonsHidden ) } >
23
23
< div
24
24
className = { styles . allButton }
25
25
onClick = { onShowAll }
@@ -47,14 +47,14 @@ const CardHeader = ({onCloseCards, onToggleCards, onShowAll, totalSteps, step, t
47
47
) : null }
48
48
< div className = { styles . headerButtonsRight } >
49
49
< div
50
- className = { styles . toggleButton }
51
- onClick = { onToggleCards }
50
+ className = { styles . shrinkExpandButton }
51
+ onClick = { onShrinkExpandCards }
52
52
>
53
53
< img
54
54
draggable = { false }
55
- src = { toggle ? shrinkIcon : expandIcon }
55
+ src = { expanded ? shrinkIcon : expandIcon }
56
56
/>
57
- { toggle ? 'Shrink' : 'Expand' }
57
+ { expanded ? 'Shrink' : 'Expand' }
58
58
</ div >
59
59
< div
60
60
className = { styles . removeButton }
@@ -123,13 +123,13 @@ ImageStep.propTypes = {
123
123
title : PropTypes . node . isRequired
124
124
} ;
125
125
126
- const NextPrevButtons = ( { isRtl, onNextStep, onPrevStep, toggle } ) => (
126
+ const NextPrevButtons = ( { isRtl, onNextStep, onPrevStep, expanded } ) => (
127
127
< Fragment >
128
128
{ onNextStep ? (
129
129
< div >
130
- < div className = { toggle ? ( isRtl ? styles . leftCard : styles . rightCard ) : styles . hidden } />
130
+ < div className = { expanded ? ( isRtl ? styles . leftCard : styles . rightCard ) : styles . hidden } />
131
131
< div
132
- className = { toggle ? ( isRtl ? styles . leftButton : styles . rightButton ) : styles . hidden }
132
+ className = { expanded ? ( isRtl ? styles . leftButton : styles . rightButton ) : styles . hidden }
133
133
onClick = { onNextStep }
134
134
>
135
135
< img
@@ -141,9 +141,9 @@ const NextPrevButtons = ({isRtl, onNextStep, onPrevStep, toggle}) => (
141
141
) : null }
142
142
{ onPrevStep ? (
143
143
< div >
144
- < div className = { toggle ? ( isRtl ? styles . rightCard : styles . leftCard ) : styles . hidden } />
144
+ < div className = { expanded ? ( isRtl ? styles . rightCard : styles . leftCard ) : styles . hidden } />
145
145
< div
146
- className = { toggle ? ( isRtl ? styles . rightButton : styles . leftButton ) : styles . hidden }
146
+ className = { expanded ? ( isRtl ? styles . rightButton : styles . leftButton ) : styles . hidden }
147
147
onClick = { onPrevStep }
148
148
>
149
149
< img
@@ -157,17 +157,17 @@ const NextPrevButtons = ({isRtl, onNextStep, onPrevStep, toggle}) => (
157
157
) ;
158
158
159
159
NextPrevButtons . propTypes = {
160
+ expanded : PropTypes . bool . isRequired ,
160
161
isRtl : PropTypes . bool ,
161
162
onNextStep : PropTypes . func ,
162
- onPrevStep : PropTypes . func ,
163
- toggle : PropTypes . bool . isRequired
163
+ onPrevStep : PropTypes . func
164
164
} ;
165
165
CardHeader . propTypes = {
166
+ expanded : PropTypes . bool . isRequired ,
166
167
onCloseCards : PropTypes . func . isRequired ,
167
168
onShowAll : PropTypes . func . isRequired ,
168
- onToggleCards : PropTypes . func . isRequired ,
169
+ onShrinkExpandCards : PropTypes . func . isRequired ,
169
170
step : PropTypes . number ,
170
- toggle : PropTypes . bool . isRequired ,
171
171
totalSteps : PropTypes . number
172
172
} ;
173
173
@@ -238,15 +238,15 @@ const Cards = props => {
238
238
locale,
239
239
onActivateDeckFactory,
240
240
onCloseCards,
241
- onToggleCards ,
241
+ onShrinkExpandCards ,
242
242
onDrag,
243
243
onStartDrag,
244
244
onEndDrag,
245
245
onShowAll,
246
246
onNextStep,
247
247
onPrevStep,
248
248
step,
249
- toggle ,
249
+ expanded ,
250
250
...posProps
251
251
} = props ;
252
252
let { x, y} = posProps ;
@@ -276,14 +276,14 @@ const Cards = props => {
276
276
< div className = { styles . cardContainer } >
277
277
< div className = { styles . card } >
278
278
< CardHeader
279
+ expanded = { expanded }
279
280
step = { step }
280
- toggle = { toggle }
281
281
totalSteps = { steps . length }
282
282
onCloseCards = { onCloseCards }
283
283
onShowAll = { onShowAll }
284
- onToggleCards = { onToggleCards }
284
+ onShrinkExpandCards = { onShrinkExpandCards }
285
285
/>
286
- < div className = { toggle ? styles . stepBody : styles . hidden } >
286
+ < div className = { expanded ? styles . stepBody : styles . hidden } >
287
287
{ steps [ step ] . deckIds ? (
288
288
< PreviewsStep
289
289
content = { content }
@@ -307,8 +307,8 @@ const Cards = props => {
307
307
{ steps [ step ] . trackingPixel && steps [ step ] . trackingPixel }
308
308
</ div >
309
309
< NextPrevButtons
310
+ expanded = { expanded }
310
311
isRtl = { isRtl }
311
- toggle = { toggle }
312
312
onNextStep = { step < steps . length - 1 ? onNextStep : null }
313
313
onPrevStep = { step > 0 ? onPrevStep : null }
314
314
/>
@@ -333,6 +333,7 @@ Cards.propTypes = {
333
333
} )
334
334
} ) ,
335
335
dragging : PropTypes . bool . isRequired ,
336
+ expanded : PropTypes . bool . isRequired ,
336
337
isRtl : PropTypes . bool . isRequired ,
337
338
locale : PropTypes . string . isRequired ,
338
339
onActivateDeckFactory : PropTypes . func . isRequired ,
@@ -342,10 +343,9 @@ Cards.propTypes = {
342
343
onNextStep : PropTypes . func . isRequired ,
343
344
onPrevStep : PropTypes . func . isRequired ,
344
345
onShowAll : PropTypes . func ,
346
+ onShrinkExpandCards : PropTypes . func . isRequired ,
345
347
onStartDrag : PropTypes . func ,
346
- onToggleCards : PropTypes . func . isRequired ,
347
348
step : PropTypes . number . isRequired ,
348
- toggle : PropTypes . bool . isRequired ,
349
349
x : PropTypes . number ,
350
350
y : PropTypes . number
351
351
} ;
0 commit comments