@momo-kits/carousel 0.0.62-alpha.22 → 0.0.62-alpha.25

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/carousel",
3
- "version": "0.0.62-alpha.22",
3
+ "version": "0.0.62-alpha.25",
4
4
  "private": false,
5
5
  "main": "index.js",
6
6
  "dependencies": {
@@ -3,7 +3,7 @@ import { I18nManager, Platform, View } from 'react-native';
3
3
  import PropTypes from 'prop-types';
4
4
  import PaginationDot from './PaginationDot';
5
5
  import styles from './styles';
6
- import { Colors } from '@momo-kits/core-v2';
6
+ import { Colors, Radius, Spacing } from '@momo-kits/core-v2';
7
7
 
8
8
  const IS_IOS = Platform.OS === 'ios';
9
9
  const IS_RTL = I18nManager.isRTL;
@@ -62,6 +62,7 @@ export default class Pagination extends PureComponent {
62
62
  inactiveDotStyle,
63
63
  renderDots,
64
64
  tappableDots,
65
+ type,
65
66
  } = this.props;
66
67
 
67
68
  if (renderDots) {
@@ -80,6 +81,7 @@ export default class Pagination extends PureComponent {
80
81
  inactiveOpacity={inactiveDotOpacity}
81
82
  inactiveScale={inactiveDotScale}
82
83
  inactiveStyle={inactiveDotStyle}
84
+ type={type}
83
85
  />
84
86
  );
85
87
 
@@ -108,8 +110,13 @@ export default class Pagination extends PureComponent {
108
110
  }
109
111
 
110
112
  render() {
111
- const { dotsLength, containerStyle, vertical, accessibilityLabel } =
112
- this.props;
113
+ const {
114
+ dotsLength,
115
+ containerStyle,
116
+ vertical,
117
+ accessibilityLabel,
118
+ type,
119
+ } = this.props;
113
120
 
114
121
  if (!dotsLength || dotsLength < 2) {
115
122
  return false;
@@ -133,7 +140,19 @@ export default class Pagination extends PureComponent {
133
140
  style={style}
134
141
  accessible={!!accessibilityLabel}
135
142
  accessibilityLabel={accessibilityLabel}>
136
- {this.dots}
143
+ <View
144
+ style={[
145
+ {
146
+ flexDirection: 'row',
147
+ padding: Spacing.XS,
148
+ borderRadius: Radius.S,
149
+ },
150
+ type === 'light'
151
+ ? {}
152
+ : { backgroundColor: Colors.opacity_02_white_20 },
153
+ ]}>
154
+ {this.dots}
155
+ </View>
137
156
  </View>
138
157
  );
139
158
  }
@@ -157,6 +176,7 @@ Pagination.propTypes = {
157
176
  accessibilityLabel: PropTypes.string,
158
177
  containerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
159
178
  dotContainerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
179
+ type: PropTypes.oneOf(['light', 'dark']),
160
180
  };
161
181
 
162
182
  Pagination.defaultProps = {
@@ -164,4 +184,5 @@ Pagination.defaultProps = {
164
184
  inactiveDotScale: 0.5,
165
185
  tappableDots: false,
166
186
  vertical: false,
187
+ type: 'light',
167
188
  };
@@ -78,10 +78,10 @@ export default class PaginationDot extends PureComponent {
78
78
  inactiveColor,
79
79
  inactiveStyle,
80
80
  inactiveOpacity,
81
- inactiveScale,
82
81
  index,
83
82
  style,
84
83
  tappable,
84
+ type,
85
85
  } = this.props;
86
86
 
87
87
  const animatedStyle = {
@@ -114,7 +114,9 @@ export default class PaginationDot extends PureComponent {
114
114
  (!active && inactiveStyle) || {},
115
115
  !active && { backgroundColor: Colors.black_10 },
116
116
  animatedStyle,
117
- animatedColor,
117
+ type === 'light'
118
+ ? animatedColor
119
+ : { backgroundColor: Colors.black_01 },
118
120
  ];
119
121
 
120
122
  const onPress = tappable
@@ -136,7 +138,6 @@ export default class PaginationDot extends PureComponent {
136
138
  }
137
139
  PaginationDot.propTypes = {
138
140
  inactiveOpacity: PropTypes.number.isRequired,
139
- inactiveScale: PropTypes.number.isRequired,
140
141
  active: PropTypes.bool,
141
142
  activeOpacity: PropTypes.number,
142
143
  carouselRef: PropTypes.object,