@momo-kits/step 0.0.61-beta.8 → 0.0.62-alpha.13
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/Step.horizontal.js +3 -2
- package/Step.vertical.js +23 -5
- package/package.json +2 -2
package/Step.horizontal.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Colors, IconSource, Image, Spacing } from '@momo-kits/core-v2';
|
|
2
|
-
import { Text } from '@momo-kits/core';
|
|
1
|
+
import { Colors, IconSource, Image, Spacing, Text } from '@momo-kits/core-v2';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { StyleSheet, View } from 'react-native';
|
|
@@ -96,6 +95,7 @@ const HorizontalStep = (props) => {
|
|
|
96
95
|
styles.circleText,
|
|
97
96
|
{
|
|
98
97
|
fontSize: CIRCLE_TEXT_SIZE,
|
|
98
|
+
lineHeight: CIRCLE_TEXT_SIZE + 2,
|
|
99
99
|
},
|
|
100
100
|
]}>
|
|
101
101
|
{index + 1}
|
|
@@ -108,6 +108,7 @@ const HorizontalStep = (props) => {
|
|
|
108
108
|
styles.circleText,
|
|
109
109
|
{
|
|
110
110
|
fontSize: CIRCLE_TEXT_SIZE,
|
|
111
|
+
lineHeight: CIRCLE_TEXT_SIZE + 2,
|
|
111
112
|
},
|
|
112
113
|
]}>
|
|
113
114
|
{index + 1}
|
package/Step.vertical.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
Image,
|
|
5
5
|
ScaleSize,
|
|
6
6
|
Spacing,
|
|
7
|
+
Text,
|
|
7
8
|
} from '@momo-kits/core-v2';
|
|
8
|
-
import { Text } from '@momo-kits/core';
|
|
9
9
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { StyleSheet, View } from 'react-native';
|
|
@@ -104,6 +104,7 @@ const VerticalStep = (props) => {
|
|
|
104
104
|
styles.circleText,
|
|
105
105
|
{
|
|
106
106
|
fontSize: CIRCLE_TEXT_SIZE,
|
|
107
|
+
lineHeight: CIRCLE_TEXT_SIZE + 2,
|
|
107
108
|
},
|
|
108
109
|
]}>
|
|
109
110
|
{index + 1}
|
|
@@ -116,6 +117,7 @@ const VerticalStep = (props) => {
|
|
|
116
117
|
styles.circleText,
|
|
117
118
|
{
|
|
118
119
|
fontSize: CIRCLE_TEXT_SIZE,
|
|
120
|
+
lineHeight: CIRCLE_TEXT_SIZE + 2,
|
|
119
121
|
},
|
|
120
122
|
]}>
|
|
121
123
|
{index + 1}
|
|
@@ -171,11 +173,25 @@ const VerticalStep = (props) => {
|
|
|
171
173
|
);
|
|
172
174
|
};
|
|
173
175
|
|
|
174
|
-
const renderContent = (content, error, index) => {
|
|
176
|
+
const renderContent = (content, error, index, size) => {
|
|
175
177
|
const disabledColor = Colors.black_09;
|
|
178
|
+
let marginBottom = size === 'small' ? Spacing.S : Spacing.M;
|
|
179
|
+
let minHeight = ScaleSize(30);
|
|
180
|
+
|
|
181
|
+
if (index === steps.length - 1) {
|
|
182
|
+
marginBottom = 0;
|
|
183
|
+
minHeight = 0;
|
|
184
|
+
}
|
|
176
185
|
|
|
177
186
|
return (
|
|
178
|
-
<View
|
|
187
|
+
<View
|
|
188
|
+
style={[
|
|
189
|
+
styles.content,
|
|
190
|
+
{
|
|
191
|
+
marginBottom,
|
|
192
|
+
minHeight,
|
|
193
|
+
},
|
|
194
|
+
]}>
|
|
179
195
|
{content && typeof content === 'string' ? (
|
|
180
196
|
<Text
|
|
181
197
|
style={[
|
|
@@ -212,7 +228,7 @@ const VerticalStep = (props) => {
|
|
|
212
228
|
</View>
|
|
213
229
|
<View style={styles.contentContainer}>
|
|
214
230
|
{renderHeader(title, subTitle, error, index)}
|
|
215
|
-
{renderContent(content, error, index)}
|
|
231
|
+
{renderContent(content, error, index, size)}
|
|
216
232
|
</View>
|
|
217
233
|
</View>
|
|
218
234
|
);
|
|
@@ -241,7 +257,9 @@ const styles = StyleSheet.create({
|
|
|
241
257
|
alignItems: 'center',
|
|
242
258
|
},
|
|
243
259
|
contentContainer: { marginLeft: Spacing.S, flex: 1 },
|
|
244
|
-
content: {
|
|
260
|
+
content: {
|
|
261
|
+
marginTop: Spacing.XS,
|
|
262
|
+
},
|
|
245
263
|
contentText: {
|
|
246
264
|
color: Colors.black_12,
|
|
247
265
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@momo-kits/step",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.62-alpha.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"dependencies": {},
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"react-native": ">=0.55",
|
|
9
9
|
"prop-types": "^15.7.2",
|
|
10
10
|
"react": "16.9.0",
|
|
11
|
-
"@momo-kits/core": ">=0.0.5-beta"
|
|
11
|
+
"@momo-kits/core-v2": ">=0.0.5-beta"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {},
|
|
14
14
|
"license": "MoMo"
|