@momo-kits/template 0.81.5 → 0.81.6

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,5 +1,5 @@
1
1
  import React, {FC} from 'react';
2
- import {Animated, TouchableOpacity} from 'react-native';
2
+ import {Animated, TouchableOpacity, View} from 'react-native';
3
3
  import Carousel from '@momo-kits/carousel';
4
4
  import {Image, Pagination, Spacing} from '@momo-kits/foundation';
5
5
  import {HeaderSliderBannerProps} from './types';
@@ -17,7 +17,7 @@ const HeaderSliderBanner: FC<HeaderSliderBannerProps> = ({
17
17
  }) => {
18
18
  const scale = animatedValue.interpolate({
19
19
  inputRange: [-300, 0, 300],
20
- outputRange: [2, 1, 1],
20
+ outputRange: [4, 1, 1],
21
21
  extrapolate: 'clamp',
22
22
  });
23
23
  const opacity = animatedValue.interpolate({
@@ -27,10 +27,15 @@ const HeaderSliderBanner: FC<HeaderSliderBannerProps> = ({
27
27
  });
28
28
  const translateY = animatedValue.interpolate({
29
29
  inputRange: [-300, 0],
30
- outputRange: [-160, -2],
30
+ outputRange: [-80, -2],
31
31
  extrapolate: 'clamp',
32
32
  });
33
33
 
34
+ const paginationOpacity = animatedValue.interpolate({
35
+ inputRange: [-40, 0],
36
+ outputRange: [0, 1],
37
+ });
38
+
34
39
  const renderItem = (info: {item: any; index: number}) => {
35
40
  const {item, index} = info;
36
41
  return (
@@ -49,29 +54,31 @@ const HeaderSliderBanner: FC<HeaderSliderBannerProps> = ({
49
54
  <Animated.View
50
55
  style={{
51
56
  height: 210,
52
- // aspectRatio: 1.75,
53
57
  opacity: opacity,
54
58
  transform: [{scale}, {translateY}],
59
+ backgroundColor: 'red',
55
60
  }}>
56
61
  <Carousel
57
62
  {...carouselProps}
58
- autoplay
59
63
  full={true}
60
64
  data={data}
61
65
  onSnapToItem={onSnapToItem}
62
66
  renderItem={renderItem}
63
67
  />
64
- <Pagination
65
- {...paginationProps}
68
+ <Animated.View
66
69
  style={{
67
70
  position: 'absolute',
68
71
  bottom: paginationBottom - Spacing.S,
69
72
  alignSelf: 'center',
70
- }}
71
- activeIndex={activeIndex}
72
- dataLength={data.length}
73
- type={paginationType}
74
- />
73
+ opacity: paginationOpacity,
74
+ }}>
75
+ <Pagination
76
+ {...paginationProps}
77
+ activeIndex={activeIndex}
78
+ dataLength={data.length}
79
+ type={paginationType}
80
+ />
81
+ </Animated.View>
75
82
  </Animated.View>
76
83
  );
77
84
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/template",
3
- "version": "0.81.5",
3
+ "version": "0.81.6",
4
4
  "private": false,
5
5
  "main": "index.tsx",
6
6
  "dependencies": {},