@momo-kits/carousel 0.0.3-beta → 0.0.7
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/Carousel.js +1390 -1
- package/index.js +6 -1
- package/package.json +3 -10
- package/pagination/Pagination.js +158 -1
- package/pagination/PaginationDot.js +145 -1
- package/pagination/styles.js +24 -1
- package/publish.sh +1 -1
- package/styles.js +189 -1
- package/utils/animation.js +329 -1
- package/babel.config.js +0 -1
package/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import Carousel from './Carousel';
|
|
2
|
+
import Pagination from './pagination/Pagination';
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
Carousel, Pagination
|
|
6
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/carousel",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {
|
|
@@ -11,13 +11,6 @@
|
|
|
11
11
|
"react": "16.9.0",
|
|
12
12
|
"react-native": ">=0.55"
|
|
13
13
|
},
|
|
14
|
-
"devDependencies": {
|
|
15
|
-
|
|
16
|
-
"@babel/core": "^7.12.9",
|
|
17
|
-
"@babel/runtime": "^7.12.5"
|
|
18
|
-
},
|
|
19
|
-
"license": "MOMO",
|
|
20
|
-
"jest": {
|
|
21
|
-
"preset": "react-native"
|
|
22
|
-
}
|
|
14
|
+
"devDependencies": {},
|
|
15
|
+
"license": "MoMo"
|
|
23
16
|
}
|
package/pagination/Pagination.js
CHANGED
|
@@ -1 +1,158 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
I18nManager, Platform, View
|
|
4
|
+
} from 'react-native';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import PaginationDot from './PaginationDot';
|
|
7
|
+
import styles from './styles';
|
|
8
|
+
|
|
9
|
+
const IS_IOS = Platform.OS === 'ios';
|
|
10
|
+
const IS_RTL = I18nManager.isRTL;
|
|
11
|
+
|
|
12
|
+
export default class Pagination extends PureComponent {
|
|
13
|
+
constructor(props) {
|
|
14
|
+
super(props);
|
|
15
|
+
|
|
16
|
+
// Warnings
|
|
17
|
+
if ((props.dotColor && !props.inactiveDotColor) || (!props.dotColor && props.inactiveDotColor)) {
|
|
18
|
+
console.warn(
|
|
19
|
+
'react-native-snap-carousel | Pagination: '
|
|
20
|
+
+ 'You need to specify both `dotColor` and `inactiveDotColor`'
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
if ((props.dotElement && !props.inactiveDotElement) || (!props.dotElement && props.inactiveDotElement)) {
|
|
24
|
+
console.warn(
|
|
25
|
+
'react-native-snap-carousel | Pagination: '
|
|
26
|
+
+ 'You need to specify both `dotElement` and `inactiveDotElement`'
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
if (props.tappableDots && !props.carouselRef) {
|
|
30
|
+
console.warn(
|
|
31
|
+
'react-native-snap-carousel | Pagination: '
|
|
32
|
+
+ 'You must specify prop `carouselRef` when setting `tappableDots` to `true`'
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
_needsRTLAdaptations() {
|
|
38
|
+
const { vertical } = this.props;
|
|
39
|
+
return IS_RTL && !IS_IOS && !vertical;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get _activeDotIndex() {
|
|
43
|
+
const { activeDotIndex, dotsLength } = this.props;
|
|
44
|
+
return this._needsRTLAdaptations() ? dotsLength - activeDotIndex - 1 : activeDotIndex;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
get dots() {
|
|
48
|
+
const {
|
|
49
|
+
activeOpacity,
|
|
50
|
+
carouselRef,
|
|
51
|
+
dotsLength,
|
|
52
|
+
dotColor,
|
|
53
|
+
dotContainerStyle,
|
|
54
|
+
dotElement,
|
|
55
|
+
dotStyle,
|
|
56
|
+
inactiveDotColor,
|
|
57
|
+
inactiveDotElement,
|
|
58
|
+
inactiveDotOpacity,
|
|
59
|
+
inactiveDotScale,
|
|
60
|
+
inactiveDotStyle,
|
|
61
|
+
renderDots,
|
|
62
|
+
tappableDots
|
|
63
|
+
} = this.props;
|
|
64
|
+
|
|
65
|
+
if (renderDots) {
|
|
66
|
+
return renderDots(this._activeDotIndex, dotsLength, this);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const DefaultDot = (
|
|
70
|
+
<PaginationDot
|
|
71
|
+
carouselRef={carouselRef}
|
|
72
|
+
tappable={tappableDots && typeof carouselRef !== 'undefined'}
|
|
73
|
+
activeOpacity={activeOpacity}
|
|
74
|
+
color={dotColor}
|
|
75
|
+
containerStyle={dotContainerStyle}
|
|
76
|
+
style={dotStyle}
|
|
77
|
+
inactiveColor={inactiveDotColor}
|
|
78
|
+
inactiveOpacity={inactiveDotOpacity}
|
|
79
|
+
inactiveScale={inactiveDotScale}
|
|
80
|
+
inactiveStyle={inactiveDotStyle}
|
|
81
|
+
/>
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
const dots = [];
|
|
85
|
+
|
|
86
|
+
for (let i = 0; i < dotsLength; i += 1) {
|
|
87
|
+
const isActive = i === this._activeDotIndex;
|
|
88
|
+
dots.push(React.cloneElement(
|
|
89
|
+
(isActive ? dotElement : inactiveDotElement) || DefaultDot,
|
|
90
|
+
{
|
|
91
|
+
key: `pagination-dot-${i}`,
|
|
92
|
+
active: i === this._activeDotIndex,
|
|
93
|
+
index: i
|
|
94
|
+
}
|
|
95
|
+
));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return dots;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
render() {
|
|
102
|
+
const {
|
|
103
|
+
dotsLength, containerStyle, vertical, accessibilityLabel
|
|
104
|
+
} = this.props;
|
|
105
|
+
|
|
106
|
+
if (!dotsLength || dotsLength < 2) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const style = [
|
|
111
|
+
styles.sliderPagination,
|
|
112
|
+
{
|
|
113
|
+
flexDirection: vertical
|
|
114
|
+
? 'column'
|
|
115
|
+
: (this._needsRTLAdaptations() ? 'row-reverse' : 'row')
|
|
116
|
+
},
|
|
117
|
+
containerStyle || {}
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<View
|
|
122
|
+
pointerEvents="box-none"
|
|
123
|
+
style={style}
|
|
124
|
+
accessible={!!accessibilityLabel}
|
|
125
|
+
accessibilityLabel={accessibilityLabel}
|
|
126
|
+
>
|
|
127
|
+
{ this.dots }
|
|
128
|
+
</View>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
Pagination.propTypes = {
|
|
133
|
+
activeDotIndex: PropTypes.number.isRequired,
|
|
134
|
+
dotsLength: PropTypes.number.isRequired,
|
|
135
|
+
activeOpacity: PropTypes.number,
|
|
136
|
+
carouselRef: PropTypes.object,
|
|
137
|
+
dotColor: PropTypes.string,
|
|
138
|
+
dotElement: PropTypes.element,
|
|
139
|
+
dotStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
140
|
+
inactiveDotColor: PropTypes.string,
|
|
141
|
+
inactiveDotElement: PropTypes.element,
|
|
142
|
+
inactiveDotOpacity: PropTypes.number,
|
|
143
|
+
inactiveDotScale: PropTypes.number,
|
|
144
|
+
inactiveDotStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
145
|
+
renderDots: PropTypes.func,
|
|
146
|
+
tappableDots: PropTypes.bool,
|
|
147
|
+
vertical: PropTypes.bool,
|
|
148
|
+
accessibilityLabel: PropTypes.string,
|
|
149
|
+
containerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
150
|
+
dotContainerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array])
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
Pagination.defaultProps = {
|
|
154
|
+
inactiveDotOpacity: 0.5,
|
|
155
|
+
inactiveDotScale: 0.5,
|
|
156
|
+
tappableDots: false,
|
|
157
|
+
vertical: false
|
|
158
|
+
};
|
|
@@ -1 +1,145 @@
|
|
|
1
|
-
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Animated, Easing, TouchableOpacity
|
|
4
|
+
} from 'react-native';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import styles from './styles';
|
|
7
|
+
|
|
8
|
+
export default class PaginationDot extends PureComponent {
|
|
9
|
+
constructor(props) {
|
|
10
|
+
super(props);
|
|
11
|
+
this.state = {
|
|
12
|
+
animColor: new Animated.Value(0),
|
|
13
|
+
animOpacity: new Animated.Value(0),
|
|
14
|
+
animTransform: new Animated.Value(0)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
componentDidMount() {
|
|
19
|
+
const { active } = this.props;
|
|
20
|
+
if (active) {
|
|
21
|
+
this._animate(1);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
26
|
+
const { active } = this.props;
|
|
27
|
+
if (nextProps.active !== active) {
|
|
28
|
+
this._animate(nextProps.active ? 1 : 0);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_animate(toValue = 0) {
|
|
33
|
+
const { animColor, animOpacity, animTransform } = this.state;
|
|
34
|
+
|
|
35
|
+
const commonProperties = {
|
|
36
|
+
toValue,
|
|
37
|
+
duration: 250,
|
|
38
|
+
isInteraction: false,
|
|
39
|
+
useNativeDriver: !this._shouldAnimateColor
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const animations = [
|
|
43
|
+
Animated.timing(animOpacity, {
|
|
44
|
+
easing: Easing.linear,
|
|
45
|
+
...commonProperties
|
|
46
|
+
}),
|
|
47
|
+
Animated.spring(animTransform, {
|
|
48
|
+
friction: 4,
|
|
49
|
+
tension: 50,
|
|
50
|
+
...commonProperties
|
|
51
|
+
})
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
if (this._shouldAnimateColor) {
|
|
55
|
+
animations.push(Animated.timing(animColor, {
|
|
56
|
+
easing: Easing.linear,
|
|
57
|
+
...commonProperties
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
Animated.parallel(animations).start();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
get _shouldAnimateColor() {
|
|
65
|
+
const { color, inactiveColor } = this.props;
|
|
66
|
+
return color && inactiveColor;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
render() {
|
|
70
|
+
const { animColor, animOpacity, animTransform } = this.state;
|
|
71
|
+
const {
|
|
72
|
+
active,
|
|
73
|
+
activeOpacity,
|
|
74
|
+
carouselRef,
|
|
75
|
+
color,
|
|
76
|
+
containerStyle,
|
|
77
|
+
inactiveColor,
|
|
78
|
+
inactiveStyle,
|
|
79
|
+
inactiveOpacity,
|
|
80
|
+
inactiveScale,
|
|
81
|
+
index,
|
|
82
|
+
style,
|
|
83
|
+
tappable
|
|
84
|
+
} = this.props;
|
|
85
|
+
|
|
86
|
+
const animatedStyle = {
|
|
87
|
+
opacity: animOpacity.interpolate({
|
|
88
|
+
inputRange: [0, 1],
|
|
89
|
+
outputRange: [inactiveOpacity, 1]
|
|
90
|
+
}),
|
|
91
|
+
transform: [{
|
|
92
|
+
scale: animTransform.interpolate({
|
|
93
|
+
inputRange: [0, 1],
|
|
94
|
+
outputRange: [inactiveScale, 1]
|
|
95
|
+
})
|
|
96
|
+
}]
|
|
97
|
+
};
|
|
98
|
+
const animatedColor = this._shouldAnimateColor ? {
|
|
99
|
+
backgroundColor: animColor.interpolate({
|
|
100
|
+
inputRange: [0, 1],
|
|
101
|
+
outputRange: [inactiveColor, color]
|
|
102
|
+
})
|
|
103
|
+
} : {};
|
|
104
|
+
|
|
105
|
+
const dotContainerStyle = [
|
|
106
|
+
styles.sliderPaginationDotContainer,
|
|
107
|
+
containerStyle || {}
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
const dotStyle = [
|
|
111
|
+
styles.sliderPaginationDot,
|
|
112
|
+
style || {},
|
|
113
|
+
(!active && inactiveStyle) || {},
|
|
114
|
+
animatedStyle,
|
|
115
|
+
animatedColor
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
const onPress = tappable ? () => carouselRef && carouselRef._snapToItem(carouselRef._getPositionIndex(index)) : undefined;
|
|
119
|
+
|
|
120
|
+
return (
|
|
121
|
+
<TouchableOpacity
|
|
122
|
+
accessible={false}
|
|
123
|
+
style={dotContainerStyle}
|
|
124
|
+
activeOpacity={tappable ? activeOpacity : 1}
|
|
125
|
+
onPress={onPress}
|
|
126
|
+
>
|
|
127
|
+
<Animated.View style={dotStyle} />
|
|
128
|
+
</TouchableOpacity>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
PaginationDot.propTypes = {
|
|
133
|
+
inactiveOpacity: PropTypes.number.isRequired,
|
|
134
|
+
inactiveScale: PropTypes.number.isRequired,
|
|
135
|
+
active: PropTypes.bool,
|
|
136
|
+
activeOpacity: PropTypes.number,
|
|
137
|
+
carouselRef: PropTypes.object,
|
|
138
|
+
color: PropTypes.string,
|
|
139
|
+
inactiveColor: PropTypes.string,
|
|
140
|
+
index: PropTypes.number,
|
|
141
|
+
tappable: PropTypes.bool,
|
|
142
|
+
style: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
143
|
+
containerStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
144
|
+
inactiveStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
|
|
145
|
+
};
|
package/pagination/styles.js
CHANGED
|
@@ -1 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_DOT_SIZE = 7;
|
|
4
|
+
const DEFAULT_DOT_COLOR = 'rgba(0, 0, 0, 0.75)';
|
|
5
|
+
|
|
6
|
+
export default StyleSheet.create({
|
|
7
|
+
sliderPagination: {
|
|
8
|
+
alignItems: 'center',
|
|
9
|
+
justifyContent: 'center',
|
|
10
|
+
paddingHorizontal: 20,
|
|
11
|
+
// paddingVertical: 30
|
|
12
|
+
},
|
|
13
|
+
sliderPaginationDotContainer: {
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
marginHorizontal: 8
|
|
17
|
+
},
|
|
18
|
+
sliderPaginationDot: {
|
|
19
|
+
width: DEFAULT_DOT_SIZE,
|
|
20
|
+
height: DEFAULT_DOT_SIZE,
|
|
21
|
+
borderRadius: DEFAULT_DOT_SIZE / 2,
|
|
22
|
+
backgroundColor: DEFAULT_DOT_COLOR
|
|
23
|
+
}
|
|
24
|
+
});
|
package/publish.sh
CHANGED
|
@@ -12,7 +12,7 @@ echo VERSION: $VERSION
|
|
|
12
12
|
rsync -r --verbose --exclude '*.mdx' --exclude '*Demo.js' --exclude 'props-type.js' --exclude 'prop-types.js' ./* dist
|
|
13
13
|
|
|
14
14
|
# #babel component to dist
|
|
15
|
-
babel ./dist -d dist --copy-files
|
|
15
|
+
#babel ./dist -d dist --copy-files
|
|
16
16
|
|
|
17
17
|
#copy option
|
|
18
18
|
#cp -r ./src/ dist
|
package/styles.js
CHANGED
|
@@ -1 +1,189 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import {
|
|
3
|
+
StyleSheet, Dimensions, Platform
|
|
4
|
+
} from 'react-native';
|
|
5
|
+
|
|
6
|
+
const IS_IOS = Platform.OS === 'ios';
|
|
7
|
+
const { width: viewportWidth, height: viewportHeight } = Dimensions.get('window');
|
|
8
|
+
|
|
9
|
+
function wp(percentage) {
|
|
10
|
+
const value = (percentage * viewportWidth) / 100;
|
|
11
|
+
return Math.round(value);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const slideHeight = viewportHeight * 0.36;
|
|
15
|
+
const slideWidth = wp(75);
|
|
16
|
+
const itemHorizontalMargin = wp(2);
|
|
17
|
+
|
|
18
|
+
export const sliderWidth = viewportWidth;
|
|
19
|
+
export const itemWidth = slideWidth + itemHorizontalMargin * 2;
|
|
20
|
+
|
|
21
|
+
const entryBorderRadius = 8;
|
|
22
|
+
|
|
23
|
+
const styles = StyleSheet.create({
|
|
24
|
+
container: {
|
|
25
|
+
flex: 1
|
|
26
|
+
},
|
|
27
|
+
contentView: {
|
|
28
|
+
paddingTop: 20,
|
|
29
|
+
backgroundColor: '#1a191c'
|
|
30
|
+
},
|
|
31
|
+
divide: {
|
|
32
|
+
width: viewportWidth,
|
|
33
|
+
height: 30
|
|
34
|
+
},
|
|
35
|
+
txtHeading: {
|
|
36
|
+
marginVertical: 15,
|
|
37
|
+
marginLeft: 10,
|
|
38
|
+
fontSize: 15,
|
|
39
|
+
color: '#000'
|
|
40
|
+
},
|
|
41
|
+
dotsArea: {
|
|
42
|
+
paddingVertical: 5,
|
|
43
|
+
position: 'absolute',
|
|
44
|
+
left: 0,
|
|
45
|
+
right: 0,
|
|
46
|
+
bottom: 0
|
|
47
|
+
},
|
|
48
|
+
dotContainer: {
|
|
49
|
+
borderWidth: 1,
|
|
50
|
+
borderColor: '#DADADA',
|
|
51
|
+
width: 8,
|
|
52
|
+
height: 8,
|
|
53
|
+
borderRadius: 4,
|
|
54
|
+
marginHorizontal: 5
|
|
55
|
+
},
|
|
56
|
+
safeArea: {
|
|
57
|
+
flex: 1,
|
|
58
|
+
backgroundColor: '#000'
|
|
59
|
+
},
|
|
60
|
+
gradient: {
|
|
61
|
+
...StyleSheet.absoluteFillObject
|
|
62
|
+
},
|
|
63
|
+
scrollview: {
|
|
64
|
+
flex: 1
|
|
65
|
+
},
|
|
66
|
+
exampleContainer: {
|
|
67
|
+
paddingVertical: 30
|
|
68
|
+
},
|
|
69
|
+
exampleContainerDark: {
|
|
70
|
+
backgroundColor: '#F3F3F3'
|
|
71
|
+
},
|
|
72
|
+
exampleContainerLight: {
|
|
73
|
+
backgroundColor: 'transparent'
|
|
74
|
+
},
|
|
75
|
+
title: {
|
|
76
|
+
paddingHorizontal: 30,
|
|
77
|
+
backgroundColor: 'transparent',
|
|
78
|
+
color: '#000',
|
|
79
|
+
fontSize: 20,
|
|
80
|
+
fontWeight: 'bold',
|
|
81
|
+
textAlign: 'center'
|
|
82
|
+
},
|
|
83
|
+
titleDark: {
|
|
84
|
+
color: '#000'
|
|
85
|
+
},
|
|
86
|
+
subtitle: {
|
|
87
|
+
marginTop: 5,
|
|
88
|
+
paddingHorizontal: 30,
|
|
89
|
+
backgroundColor: 'transparent',
|
|
90
|
+
color: '#000',
|
|
91
|
+
fontSize: 13,
|
|
92
|
+
fontStyle: 'italic',
|
|
93
|
+
textAlign: 'center'
|
|
94
|
+
},
|
|
95
|
+
slider: {
|
|
96
|
+
marginTop: 15,
|
|
97
|
+
overflow: 'visible' // for custom animations
|
|
98
|
+
},
|
|
99
|
+
sliderContentContainer: {
|
|
100
|
+
paddingVertical: 10 // for custom animation
|
|
101
|
+
},
|
|
102
|
+
paginationContainer: {
|
|
103
|
+
paddingVertical: 8
|
|
104
|
+
},
|
|
105
|
+
paginationDot: {
|
|
106
|
+
width: 8,
|
|
107
|
+
height: 8,
|
|
108
|
+
borderRadius: 4,
|
|
109
|
+
marginHorizontal: 8
|
|
110
|
+
},
|
|
111
|
+
slideInnerContainer: {
|
|
112
|
+
width: itemWidth,
|
|
113
|
+
height: slideHeight,
|
|
114
|
+
paddingHorizontal: itemHorizontalMargin,
|
|
115
|
+
paddingBottom: 18 // needed for shadow
|
|
116
|
+
},
|
|
117
|
+
shadow: {
|
|
118
|
+
position: 'absolute',
|
|
119
|
+
top: 0,
|
|
120
|
+
left: itemHorizontalMargin,
|
|
121
|
+
right: itemHorizontalMargin,
|
|
122
|
+
bottom: 18,
|
|
123
|
+
shadowColor: '#000',
|
|
124
|
+
shadowOpacity: 0.25,
|
|
125
|
+
shadowOffset: { width: 0, height: 10 },
|
|
126
|
+
shadowRadius: 10,
|
|
127
|
+
borderRadius: entryBorderRadius
|
|
128
|
+
},
|
|
129
|
+
imageContainer: {
|
|
130
|
+
flex: 1,
|
|
131
|
+
marginBottom: IS_IOS ? 0 : -1, // Prevent a random Android rendering issue
|
|
132
|
+
backgroundColor: 'white',
|
|
133
|
+
borderTopLeftRadius: entryBorderRadius,
|
|
134
|
+
borderTopRightRadius: entryBorderRadius
|
|
135
|
+
},
|
|
136
|
+
imageContainerEven: {
|
|
137
|
+
backgroundColor: '#000'
|
|
138
|
+
},
|
|
139
|
+
image: {
|
|
140
|
+
...StyleSheet.absoluteFillObject,
|
|
141
|
+
resizeMode: 'cover',
|
|
142
|
+
borderRadius: IS_IOS ? entryBorderRadius : 0,
|
|
143
|
+
borderTopLeftRadius: entryBorderRadius,
|
|
144
|
+
borderTopRightRadius: entryBorderRadius
|
|
145
|
+
},
|
|
146
|
+
// image's border radius is buggy on iOS; let's hack it!
|
|
147
|
+
radiusMask: {
|
|
148
|
+
position: 'absolute',
|
|
149
|
+
bottom: 0,
|
|
150
|
+
left: 0,
|
|
151
|
+
right: 0,
|
|
152
|
+
height: entryBorderRadius,
|
|
153
|
+
backgroundColor: 'white'
|
|
154
|
+
},
|
|
155
|
+
radiusMaskEven: {
|
|
156
|
+
backgroundColor: '#000'
|
|
157
|
+
},
|
|
158
|
+
textContainer: {
|
|
159
|
+
justifyContent: 'center',
|
|
160
|
+
paddingTop: 20 - entryBorderRadius,
|
|
161
|
+
paddingBottom: 20,
|
|
162
|
+
paddingHorizontal: 16,
|
|
163
|
+
backgroundColor: 'white',
|
|
164
|
+
borderBottomLeftRadius: entryBorderRadius,
|
|
165
|
+
borderBottomRightRadius: entryBorderRadius
|
|
166
|
+
},
|
|
167
|
+
textContainerEven: {
|
|
168
|
+
backgroundColor: '#000'
|
|
169
|
+
},
|
|
170
|
+
titleItem: {
|
|
171
|
+
color: '#000',
|
|
172
|
+
fontSize: 13,
|
|
173
|
+
fontWeight: 'bold',
|
|
174
|
+
letterSpacing: 0.5
|
|
175
|
+
},
|
|
176
|
+
titleEven: {
|
|
177
|
+
color: 'white'
|
|
178
|
+
},
|
|
179
|
+
subtitleItem: {
|
|
180
|
+
marginTop: 6,
|
|
181
|
+
color: 'black',
|
|
182
|
+
fontSize: 12,
|
|
183
|
+
fontStyle: 'italic'
|
|
184
|
+
},
|
|
185
|
+
subtitleEven: {
|
|
186
|
+
color: 'rgba(255, 255, 255, 0.7)'
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
export default styles;
|