@momo-kits/carousel 0.80.8-beta.6 → 0.80.8-beta.9
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.
- package/index.tsx +4 -2
- package/package.json +1 -1
package/index.tsx
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from 'react-native';
|
|
12
12
|
import {defaultAnimatedStyles, defaultScrollInterpolator} from './animation';
|
|
13
13
|
import {CarouselProps, CarouselRef, CarouselState, Position} from './types';
|
|
14
|
-
import {Spacing} from '@momo-kits/foundation';
|
|
14
|
+
import {scaleSize, Spacing} from '@momo-kits/foundation';
|
|
15
15
|
|
|
16
16
|
const IS_ANDROID = Platform.OS === 'android';
|
|
17
17
|
const IS_IOS = Platform.OS === 'ios';
|
|
@@ -574,7 +574,9 @@ export default class Carousel extends React.PureComponent<
|
|
|
574
574
|
(this.props.visibleItem === 1
|
|
575
575
|
? screenWidth - Spacing.M * 2
|
|
576
576
|
: Math.ceil(
|
|
577
|
-
(
|
|
577
|
+
scaleSize(
|
|
578
|
+
(containerWidth * 0.9 - visibleItem * Spacing.S) / visibleItem,
|
|
579
|
+
),
|
|
578
580
|
));
|
|
579
581
|
|
|
580
582
|
this.setState({containerWidth, itemWidth});
|