react-native-varia 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,16 @@
1
1
  import React from 'react'
2
- import {type LayoutChangeEvent, View, ViewStyle} from 'react-native'
2
+ import {type LayoutChangeEvent, StyleProp, View, ViewStyle} from 'react-native'
3
3
  import {StyleSheet, UnistylesVariants} from 'react-native-unistyles'
4
4
  import {Gesture, GestureDetector} from 'react-native-gesture-handler'
5
5
  import Animated, {
6
+ useAnimatedReaction,
6
7
  useAnimatedStyle,
7
8
  useSharedValue,
8
9
  } from 'react-native-reanimated'
9
10
  import {runOnJS} from 'react-native-worklets'
10
11
  import {SliderStyles, SliderDefaultVariants} from '../../theme/Slider.recipe'
11
12
  import {PalettesWithNestedKeys} from '../../style/varia/types'
12
- import {getCompoundVariantValue} from '../../style/varia/utils'
13
+ import {getCompoundVariantValue, getVariantValue} from '../../style/varia/utils'
13
14
 
14
15
  function throttle<T extends (...args: any[]) => any>(
15
16
  func: T,
@@ -31,11 +32,6 @@ type SliderVariants = UnistylesVariants<typeof SliderStyles>
31
32
 
32
33
  const AnimatedView = Animated.createAnimatedComponent(View)
33
34
 
34
- type ThumbStyleExtended = ReturnType<typeof SliderStyles.thumb> & {
35
- width: number
36
- height: number
37
- }
38
-
39
35
  type SliderProps = SliderVariants & {
40
36
  colorPalette?: PalettesWithNestedKeys
41
37
  thickness?: number
@@ -48,10 +44,17 @@ type SliderProps = SliderVariants & {
48
44
  thumbChildren?: React.ReactNode
49
45
  steps?: number
50
46
  value?: number
47
+ onSlidingStart?: (value: number) => void
51
48
  onValueChange?: (value: number) => void
52
49
  onSlidingComplete?: (value: number) => void
53
50
  flex?: ViewStyle['flex']
54
51
  alignSelf?: ViewStyle['alignSelf']
52
+ allowGestures?: boolean
53
+ mode?: 'normal' | 'wrap'
54
+ containerStyles?: StyleProp<ViewStyle>
55
+ maximumTrackStyles?: StyleProp<ViewStyle>
56
+ minimumTrackStyles?: StyleProp<ViewStyle>
57
+ thumbStyles?: StyleProp<ViewStyle>
55
58
  }
56
59
 
57
60
  const Slider = ({
@@ -62,10 +65,17 @@ const Slider = ({
62
65
  axis = 'x',
63
66
  value = 0,
64
67
  steps,
68
+ onSlidingStart,
65
69
  onValueChange,
66
70
  onSlidingComplete,
67
71
  flex = 0,
68
72
  alignSelf = 'auto',
73
+ allowGestures = true,
74
+ mode = 'normal',
75
+ containerStyles,
76
+ maximumTrackStyles,
77
+ minimumTrackStyles,
78
+ thumbStyles,
69
79
  }: SliderProps) => {
70
80
  SliderStyles.useVariants({
71
81
  size,
@@ -76,13 +86,13 @@ const Slider = ({
76
86
  axis,
77
87
  })
78
88
 
89
+ const normalizedValue = useSharedValue(0)
90
+
79
91
  const throttledOnValueChange = React.useMemo(() => {
80
92
  if (!onValueChange) return undefined
81
93
  return throttle(onValueChange, 50)
82
94
  }, [onValueChange])
83
95
 
84
- // const thumbStyle = SliderStyles.thumb(colorPalette) as ThumbStyleExtended
85
- // const thumbWidth = getVariantValue(SliderStyles.thumb(colorPalette), 'size', size, 'width', true)
86
96
  const thumbWidth = getCompoundVariantValue(
87
97
  SliderStyles.thumb(colorPalette),
88
98
  {axis, size},
@@ -93,11 +103,24 @@ const Slider = ({
93
103
  {axis, size},
94
104
  'height',
95
105
  )
96
- // const thumbHeight = getVariantValue(SliderStyles.thumb(colorPalette), 'size', size, 'height', true)
106
+
107
+ const maximumTrackColor =
108
+ getVariantValue(
109
+ SliderStyles.maximumTrack(colorPalette),
110
+ 'variant',
111
+ variant,
112
+ 'backgroundColor',
113
+ ) || 'transparent'
114
+
115
+ console.log(SliderStyles.maximumTrack(colorPalette))
97
116
 
98
117
  const halfSize = ((axis === 'x' ? thumbWidth : thumbHeight) ?? 0) / 2
118
+
99
119
  const context = useSharedValue({x: 0})
100
- const translate = useSharedValue(value)
120
+
121
+ // ❗️CAMBIO 1: translate SIEMPRE en píxeles
122
+ const translate = useSharedValue(0)
123
+
101
124
  const trackLength = useSharedValue(0)
102
125
  const isInsideChild = useSharedValue(false)
103
126
 
@@ -106,229 +129,179 @@ const Slider = ({
106
129
  trackLength.value = axis === 'x' ? width : height
107
130
  }
108
131
 
109
- const slideGesture = Gesture.Pan()
110
- .onTouchesDown(() => {
111
- isInsideChild.value = true
112
- })
113
- .onBegin(() => {
114
- context.value.x = translate.value
115
- })
116
- .onUpdate(e => {
117
- const stepLength = steps ? trackLength.value / steps : 1
118
- const delta = axis === 'y' ? -e.translationY : e.translationX
132
+ // ❗️CAMBIO 2: sincronizar value → translate cuando hay layout
133
+ React.useEffect(() => {
134
+ if (trackLength.value <= 0) return
135
+
136
+ if (steps) {
137
+ const stepLength = trackLength.value / steps
138
+ translate.value = value * stepLength
139
+ } else {
140
+ translate.value = value * trackLength.value
141
+ }
142
+ }, [value, steps])
119
143
 
120
- const rawValue = Math.max(
121
- 0,
122
- Math.min(context.value.x + delta, trackLength.value),
123
- )
124
-
125
- const snappedValue = steps
126
- ? Math.round(rawValue / stepLength) * stepLength
127
- : rawValue
128
-
129
- translate.value = snappedValue
130
-
131
- if (steps) {
132
- const stepIndex = Math.round(snappedValue / stepLength)
133
- throttledOnValueChange && runOnJS(throttledOnValueChange)(stepIndex)
134
- } else {
135
- throttledOnValueChange &&
136
- runOnJS(throttledOnValueChange)(
137
- Math.round((snappedValue / trackLength.value) * 100) / 100,
138
- )
144
+ useAnimatedReaction(
145
+ () => normalizedValue.value,
146
+ (value, prev) => {
147
+ if (value === prev) return
148
+
149
+ if (onValueChange) {
150
+ runOnJS(onValueChange)(steps ? value : Math.round(value * 100) / 100)
139
151
  }
140
- })
141
- .onEnd(() => {
142
- const stepLength = steps ? trackLength.value / steps : 1
152
+ },
153
+ [steps],
154
+ )
143
155
 
144
- const snappedValue = steps
145
- ? Math.round(translate.value / stepLength)
146
- : translate.value / trackLength.value
156
+ const isInteracting = useSharedValue(false)
147
157
 
148
- onSlidingComplete && runOnJS(onSlidingComplete)(snappedValue)
149
- })
150
- .onFinalize(() => {
151
- isInsideChild.value = false
152
- })
158
+ const computeSnappedValue = (position: number) => {
159
+ 'worklet'
160
+ const clamped = Math.max(0, Math.min(position, trackLength.value))
161
+ if (!steps) return clamped
153
162
 
154
- const tapGesture = Gesture.Tap()
155
- .onBegin(e => {
156
- if (isInsideChild.value) {
157
- return
158
- }
159
- const tapPosition = axis === 'x' ? e.x : e.y
160
- const stepLength = steps ? trackLength.value / steps : 1
161
-
162
- const rawValue =
163
- axis === 'y'
164
- ? Math.max(
165
- 0,
166
- Math.min(trackLength.value - tapPosition, trackLength.value),
167
- )
168
- : Math.max(0, Math.min(tapPosition, trackLength.value))
169
-
170
- const snappedValue = steps
171
- ? Math.round(rawValue / stepLength) * stepLength
172
- : rawValue
173
-
174
- translate.value = snappedValue
175
-
176
- if (steps) {
177
- const stepIndex = Math.round(snappedValue / stepLength)
178
- onValueChange && runOnJS(onValueChange)(stepIndex)
179
- onSlidingComplete && runOnJS(onSlidingComplete)(stepIndex)
180
- } else {
181
- const normalizedValue =
182
- Math.round((snappedValue / trackLength.value) * 100) / 100
183
- onValueChange && runOnJS(onValueChange)(normalizedValue)
184
- onSlidingComplete && runOnJS(onSlidingComplete)(normalizedValue)
185
- }
186
- })
187
- .simultaneousWithExternalGesture(slideGesture)
163
+ const stepLength = trackLength.value / steps
164
+ return Math.round(clamped / stepLength) * stepLength
165
+ }
166
+
167
+ const toNormalizedValue = (px: number) => {
168
+ 'worklet'
169
+ return steps
170
+ ? Math.round(px / (trackLength.value / steps))
171
+ : px / trackLength.value
172
+ }
173
+
174
+ const beginInteraction = (value: number) => {
175
+ 'worklet'
176
+ if (isInteracting.value) return
177
+ isInteracting.value = true
178
+ onSlidingStart && runOnJS(onSlidingStart)(value)
179
+ }
180
+
181
+ const updateInteraction = (value: number) => {
182
+ 'worklet'
183
+ onValueChange && runOnJS(onValueChange)(value)
184
+ }
185
+
186
+ const endInteraction = (value: number) => {
187
+ 'worklet'
188
+ if (!isInteracting.value) return
189
+ isInteracting.value = false
190
+ onSlidingComplete && runOnJS(onSlidingComplete)(value)
191
+ }
192
+
193
+ const panGesture = Gesture.Pan()
194
+ .enabled(allowGestures)
195
+ .minDistance(0)
188
196
 
189
- const trackPan = Gesture.Pan()
190
197
  .onBegin(e => {
191
- if (trackLength.value <= 0) return
192
-
193
- const tapPosition = axis === 'x' ? e.x : e.y
194
- const stepLength = steps ? trackLength.value / steps : 1
195
-
196
- const rawValue =
197
- axis === 'y'
198
- ? Math.max(
199
- 0,
200
- Math.min(trackLength.value - tapPosition, trackLength.value),
201
- )
202
- : Math.max(0, Math.min(tapPosition, trackLength.value))
203
-
204
- const snappedValue = steps
205
- ? Math.round(rawValue / stepLength) * stepLength
206
- : rawValue
207
-
208
- context.value.x = snappedValue
209
- translate.value = snappedValue
210
-
211
- if (steps) {
212
- const stepIndex = Math.round(snappedValue / stepLength)
213
- onValueChange && runOnJS(onValueChange)(stepIndex)
214
- } else {
215
- const normalizedValue =
216
- Math.round((snappedValue / trackLength.value) * 100) / 100
217
- onValueChange && runOnJS(onValueChange)(normalizedValue)
218
- }
198
+ const pos = axis === 'y' ? trackLength.value - e.y : e.x
199
+ const snapped = computeSnappedValue(pos)
200
+
201
+ context.value.x = snapped
202
+ translate.value = snapped
203
+
204
+ beginInteraction(toNormalizedValue(snapped))
205
+ updateInteraction(toNormalizedValue(snapped))
219
206
  })
220
- .onUpdate(e => {
221
- if (trackLength.value <= 0) return
222
207
 
223
- const stepLength = steps ? trackLength.value / steps : 1
208
+ .onUpdate(e => {
224
209
  const delta = axis === 'y' ? -e.translationY : e.translationX
210
+ const snapped = computeSnappedValue(context.value.x + delta)
225
211
 
226
- const rawValue = Math.max(
227
- 0,
228
- Math.min(context.value.x + delta, trackLength.value),
229
- )
230
-
231
- if (steps) {
232
- const snappedValue = Math.round(rawValue / stepLength) * stepLength
233
- translate.value = snappedValue
234
-
235
- const stepIndex = Math.round(snappedValue / stepLength)
236
- throttledOnValueChange && runOnJS(throttledOnValueChange)(stepIndex)
237
- } else {
238
- translate.value = rawValue
239
- throttledOnValueChange &&
240
- runOnJS(throttledOnValueChange)(
241
- Math.round((rawValue / trackLength.value) * 100) / 100,
242
- )
243
- }
212
+ translate.value = snapped
213
+ updateInteraction(toNormalizedValue(snapped))
244
214
  })
245
- .onEnd(() => {
246
- const stepLength = steps ? trackLength.value / steps : 1
247
215
 
248
- const snappedValue = steps
249
- ? Math.round(translate.value / stepLength)
250
- : translate.value / trackLength.value
216
+ .onEnd(() => {
217
+ endInteraction(toNormalizedValue(translate.value))
218
+ })
251
219
 
252
- onSlidingComplete && runOnJS(onSlidingComplete)(snappedValue)
220
+ .onFinalize(() => {
221
+ // 🔒 garantiza cleanup incluso en cancelaciones
222
+ endInteraction(toNormalizedValue(translate.value))
253
223
  })
254
224
 
255
- const animatedTrack = useAnimatedStyle(() => {
256
- return {
257
- [axis === 'y' ? 'height' : 'width']: translate.value + halfSize,
258
- }
259
- })
225
+ const animatedTrack = useAnimatedStyle(() => ({
226
+ [axis === 'y' ? 'height' : 'width']:
227
+ translate.value + (mode === 'wrap' ? halfSize : 0),
228
+ }))
260
229
 
261
230
  const animatedThumb = useAnimatedStyle(() => {
262
231
  if (axis === 'x') {
263
- return {
264
- transform: [{translateX: translate.value - halfSize}],
265
- }
266
- } else {
267
- const translateY = trackLength.value - translate.value - halfSize
268
- return {
269
- transform: [{translateY}],
270
- }
232
+ return {transform: [{translateX: translate.value - halfSize}]}
233
+ }
234
+ return {
235
+ transform: [{translateY: trackLength.value - translate.value - halfSize}],
271
236
  }
272
237
  })
273
238
 
239
+ console.log('maximum color', maximumTrackColor)
240
+
274
241
  return (
275
242
  <View
276
243
  testID="varia-slider-container"
277
244
  style={[
278
- styles.container(halfSize, flex, alignSelf),
279
245
  SliderStyles.container(colorPalette),
246
+ containerStyles,
247
+ styles.container(
248
+ halfSize,
249
+ flex,
250
+ alignSelf,
251
+ mode === 'wrap' ? maximumTrackColor : 'transparent',
252
+ ),
280
253
  ]}>
281
- {axis === 'x' && <View style={{width: halfSize}} />}
282
- <GestureDetector gesture={Gesture.Simultaneous(trackPan, tapGesture)}>
254
+ <GestureDetector gesture={panGesture}>
283
255
  <View
284
256
  testID="varia-slider-maximun-track"
285
257
  style={[
286
- styles.maximumTrack(),
258
+ styles.maximumTrack(mode),
259
+ maximumTrackStyles,
287
260
  SliderStyles.maximumTrack(colorPalette),
288
261
  ]}
289
262
  onLayout={handleTrackLayout}>
290
263
  <AnimatedView
291
264
  testID="varia-slider-minimum-track"
292
265
  style={[
293
- styles.minimumTrack(halfSize),
294
266
  SliderStyles.minimumTrack(colorPalette),
267
+ minimumTrackStyles,
268
+ styles.minimumTrack(halfSize, mode),
295
269
  animatedTrack,
296
270
  ]}
297
271
  />
298
272
 
299
273
  {steps && (
300
- <View style={[styles.stepsOverlay]} pointerEvents="none">
301
- <View style={styles.steps} testID="varia-slider-steps">
302
- {Array.from({length: steps + 1}, (_, index) => index).map(
303
- (_, i) => (
304
- <View
305
- key={i}
306
- style={[
307
- styles.step(i, steps),
308
- SliderStyles.step(colorPalette),
309
- ]}
310
- />
311
- ),
312
- )}
274
+ <View style={styles.stepsOverlay} pointerEvents="none">
275
+ <View style={styles.steps}>
276
+ {Array.from({length: steps + 1}, (_, i) => (
277
+ <View
278
+ key={i}
279
+ style={[
280
+ styles.step(i, steps),
281
+ SliderStyles.step(colorPalette),
282
+ ]}
283
+ />
284
+ ))}
313
285
  </View>
314
286
  </View>
315
287
  )}
316
- <GestureDetector gesture={slideGesture}>
317
- <View style={styles.thumbContainerFull} testID="varia-slider-tumb">
318
- <AnimatedView style={[animatedThumb, {flex: 1}]}>
319
- <View
320
- style={[
321
- SliderStyles.thumb(colorPalette),
322
- styles.thumb(halfSize),
323
- ]}>
324
- {ThumbChildren || null}
325
- </View>
326
- </AnimatedView>
327
- </View>
328
- </GestureDetector>
288
+
289
+ <View style={styles.thumbContainerFull}>
290
+ <AnimatedView style={[animatedThumb, styles.thumbContainer]}>
291
+ <View
292
+ style={[
293
+ SliderStyles.thumb(colorPalette),
294
+ thumbStyles,
295
+ styles.thumb(halfSize),
296
+ ]}>
297
+ {ThumbChildren || null}
298
+ </View>
299
+ </AnimatedView>
300
+ </View>
301
+ {/* <GestureDetector gesture={slideGesture}>
302
+ </GestureDetector> */}
329
303
  </View>
330
304
  </GestureDetector>
331
- {axis === 'y' && <View style={{height: halfSize}} />}
332
305
  </View>
333
306
  )
334
307
  }
@@ -338,23 +311,28 @@ const styles = StyleSheet.create(theme => ({
338
311
  halfSize: number,
339
312
  flex: ViewStyle['flex'],
340
313
  alignSelf: ViewStyle['alignSelf'],
314
+ backgroundColor: ViewStyle['backgroundColor'],
341
315
  ) => ({
342
316
  flex,
343
317
  alignSelf,
344
318
  overflow: 'hidden',
319
+ backgroundColor,
320
+ alignItems: 'center',
345
321
  // flexBasis: 'auto',
346
322
  variants: {
347
323
  axis: {
348
324
  x: {
349
325
  // maxWidth: 'auto',
350
326
  paddingTop: 0,
351
- paddingRight: halfSize,
327
+ // paddingRight: halfSize,
328
+ paddingHorizontal: halfSize,
352
329
  flexDirection: 'row',
353
330
  },
354
331
  y: {
355
332
  // maxHeight: 'auto',
356
333
  // height: '100%',
357
- paddingTop: halfSize,
334
+ // paddingTop: halfSize,
335
+ paddingVertical: halfSize,
358
336
  paddingRight: 0,
359
337
  flexDirection: 'column',
360
338
  },
@@ -365,7 +343,7 @@ const styles = StyleSheet.create(theme => ({
365
343
  flex: flex === 0 ? undefined : flex,
366
344
  },
367
345
  }),
368
- maximumTrack: () => ({
346
+ maximumTrack: (mode: 'normal' | 'wrap') => ({
369
347
  flex: 1,
370
348
  position: 'relative',
371
349
  overflow: 'visible',
@@ -373,10 +351,14 @@ const styles = StyleSheet.create(theme => ({
373
351
  variants: {
374
352
  axis: {
375
353
  x: {
354
+ ...(mode === 'wrap' ? {height: '100%'} : {}),
376
355
  justifyContent: 'center',
377
356
  },
378
357
  y: {
379
- justifyContent: 'flex-end',
358
+ ...(mode === 'wrap' ? {width: '100%'} : {}),
359
+ flexDirection: 'row',
360
+ justifyContent: 'center',
361
+ alignItems: 'flex-end',
380
362
  },
381
363
  },
382
364
  },
@@ -384,26 +366,31 @@ const styles = StyleSheet.create(theme => ({
384
366
  _classNames: 'slider-maximun-track-base',
385
367
  },
386
368
  }),
387
- minimumTrack: (halfSize: number) => ({
369
+ minimumTrack: (halfSize: number, mode) => ({
388
370
  flexBasis: 'auto',
389
371
  variants: {
390
372
  axis: {
391
373
  x: {
392
- flex: 1,
393
- marginLeft: halfSize * -1,
374
+ // flex: 1,
375
+ // marginLeft: halfSize * -1,
394
376
  width: '100%',
395
377
  bottom: 'auto',
396
378
  paddingBottom: 0,
397
- paddingLeft: halfSize,
379
+ // paddingLeft: halfSize,
398
380
  justifyContent: 'center',
399
381
  alignItems: 'flex-end',
382
+ ...(mode === 'wrap'
383
+ ? {transform: [{translateX: halfSize * -1}]}
384
+ : {}),
400
385
  },
401
386
  y: {
387
+ // flex: 1,
402
388
  height: '100%',
403
- paddingBottom: halfSize,
404
- marginBottom: halfSize * -1,
389
+ // paddingBottom: halfSize,
390
+ // marginBottom: halfSize * -1,
405
391
  paddingLeft: 0,
406
392
  alignItems: 'flex-start',
393
+ ...(mode === 'wrap' ? {transform: [{translateY: halfSize}]} : {}),
407
394
  },
408
395
  },
409
396
  },
@@ -412,6 +399,7 @@ const styles = StyleSheet.create(theme => ({
412
399
  },
413
400
  }),
414
401
  thumbContainerFull: {
402
+ // overflow: 'hidden',
415
403
  position: 'absolute',
416
404
  left: 0,
417
405
  right: 0,
@@ -422,18 +410,33 @@ const styles = StyleSheet.create(theme => ({
422
410
  _classNames: 'thumb-container-full-base',
423
411
  },
424
412
  },
425
- thumb: halfSize => ({
413
+ thumbContainer: {
414
+ flex: 1,
426
415
  variants: {
427
416
  axis: {
428
417
  x: {
429
- height: '100%',
430
418
  justifyContent: 'center',
419
+ },
420
+ y: {
431
421
  alignItems: 'center',
432
422
  },
423
+ },
424
+ },
425
+ },
426
+ thumb: (halfSize: number) => ({
427
+ variants: {
428
+ axis: {
429
+ x: {
430
+ // height: '100%',
431
+ justifyContent: 'center',
432
+ alignItems: 'center',
433
+ // transform: [{translateX: halfSize * -1}],
434
+ },
433
435
  y: {
434
- width: '100%',
436
+ // width: '100%',
435
437
  justifyContent: 'center',
436
438
  alignItems: 'center',
439
+ // transform: [{translateY: halfSize * -1}],
437
440
  },
438
441
  },
439
442
  },
@@ -494,5 +497,4 @@ const styles = StyleSheet.create(theme => ({
494
497
  },
495
498
  }),
496
499
  }))
497
-
498
500
  export default Slider
@@ -1,5 +1,5 @@
1
1
  import {Children, type ReactNode, useImperativeHandle, useState} from 'react'
2
- import {View} from 'react-native'
2
+ import {StyleProp, View, ViewStyle} from 'react-native'
3
3
  import Animated, {
4
4
  useAnimatedReaction,
5
5
  useAnimatedStyle,
@@ -32,6 +32,8 @@ type SlideshowProps = SlideshowVariants & {
32
32
  onSlideChange?: (index: number) => void
33
33
  children: ReactNode
34
34
  ref?: React.RefObject<SlideshowRef | null>
35
+ containerStyles?: StyleProp<ViewStyle>
36
+ slideContainerStyles?: StyleProp<ViewStyle>
35
37
  }
36
38
 
37
39
  const Slideshow = ({
@@ -44,6 +46,8 @@ const Slideshow = ({
44
46
  animation = SlideshowTokens.defaultProps.animation,
45
47
  children,
46
48
  ref,
49
+ containerStyles,
50
+ slideContainerStyles,
47
51
  }: SlideshowProps) => {
48
52
  const isHorizontal = axis === 'x'
49
53
 
@@ -171,7 +175,11 @@ const Slideshow = ({
171
175
  <GestureDetector gesture={slideGesture}>
172
176
  <View
173
177
  testID="varia-slideshow"
174
- style={[styles.container(), SlideshowStyles.container(colorPalette)]}
178
+ style={[
179
+ SlideshowStyles.container(colorPalette),
180
+ containerStyles,
181
+ styles.container(),
182
+ ]}
175
183
  onLayout={e => {
176
184
  setContainerWidth(e.nativeEvent.layout.width)
177
185
  setContainerHeight(e.nativeEvent.layout.height)
@@ -186,8 +194,9 @@ const Slideshow = ({
186
194
  testID={`varia-slides-slide-${index}`}
187
195
  key={index}
188
196
  style={[
189
- styles.slide(`${slideSize}%`, isHorizontal),
190
197
  SlideshowStyles.slideContainer(colorPalette),
198
+ slideContainerStyles,
199
+ styles.slide(`${slideSize}%`, isHorizontal),
191
200
  ]}>
192
201
  {Slide}
193
202
  </View>