@momo-kits/foundation 0.154.1-beta.2 → 0.154.1-beta.3
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/Application/NavigationContainer.tsx +4 -0
- package/Input/InputDropDown.tsx +0 -1
- package/Input/common.tsx +4 -2
- package/Input/styles.ts +2 -1
- package/Text/index.tsx +13 -3
- package/package.json +1 -1
|
@@ -45,6 +45,9 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
|
45
45
|
}) => {
|
|
46
46
|
const context = useContext<any>(MiniAppContext);
|
|
47
47
|
const [currentContext, setCurrentContext] = useState({});
|
|
48
|
+
|
|
49
|
+
const isBaselineEnabled = context?.isBaselineEnabled ?? false;
|
|
50
|
+
|
|
48
51
|
return (
|
|
49
52
|
<SafeAreaProvider>
|
|
50
53
|
<MiniAppContext.Provider
|
|
@@ -52,6 +55,7 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
|
52
55
|
...context,
|
|
53
56
|
...currentContext,
|
|
54
57
|
features,
|
|
58
|
+
isBaselineEnabled,
|
|
55
59
|
}}
|
|
56
60
|
>
|
|
57
61
|
<Navigation
|
package/Input/InputDropDown.tsx
CHANGED
package/Input/common.tsx
CHANGED
|
@@ -62,6 +62,8 @@ export const getSizeStyle = (
|
|
|
62
62
|
size?: 'small' | 'large',
|
|
63
63
|
multiline: boolean = false,
|
|
64
64
|
) => {
|
|
65
|
+
const scaleInputHeight = useScaleSize(size === 'small' ? 48 : 56, 1.1);
|
|
66
|
+
|
|
65
67
|
if (multiline)
|
|
66
68
|
return [
|
|
67
69
|
styles.multilineContainer,
|
|
@@ -71,9 +73,9 @@ export const getSizeStyle = (
|
|
|
71
73
|
];
|
|
72
74
|
|
|
73
75
|
if (size === 'small') {
|
|
74
|
-
return styles.smallContainer;
|
|
76
|
+
return [styles.smallContainer, { height: scaleInputHeight }];
|
|
75
77
|
}
|
|
76
|
-
return styles.container;
|
|
78
|
+
return [styles.container, { height: scaleInputHeight }];
|
|
77
79
|
};
|
|
78
80
|
export const ErrorView: FC<{
|
|
79
81
|
errorMessage?: string;
|
package/Input/styles.ts
CHANGED
|
@@ -196,6 +196,7 @@ export default StyleSheet.create({
|
|
|
196
196
|
inputDropDownView: {
|
|
197
197
|
flex: 1,
|
|
198
198
|
flexDirection: 'row',
|
|
199
|
+
alignItems: 'center',
|
|
199
200
|
paddingLeft: Spacing.M,
|
|
200
201
|
},
|
|
201
202
|
iconViewDropDown: {
|
|
@@ -204,7 +205,7 @@ export default StyleSheet.create({
|
|
|
204
205
|
},
|
|
205
206
|
textViewDropDown: {
|
|
206
207
|
flex: 1,
|
|
207
|
-
marginVertical: Spacing.
|
|
208
|
+
marginVertical: Spacing.S,
|
|
208
209
|
marginRight: Spacing.S,
|
|
209
210
|
justifyContent: 'center',
|
|
210
211
|
},
|
package/Text/index.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useContext } from 'react';
|
|
|
2
2
|
import { Text as RNText, TextProps as RNTextProps, View } from 'react-native';
|
|
3
3
|
import styles from './styles';
|
|
4
4
|
import { Typography, TypographyWeight } from './types';
|
|
5
|
-
import { ApplicationContext, SkeletonContext } from '../Context';
|
|
5
|
+
import { ApplicationContext, MiniAppContext, SkeletonContext } from '../Context';
|
|
6
6
|
import { scaleSize, useScaleSize } from './utils';
|
|
7
7
|
import { Skeleton } from '../Skeleton';
|
|
8
8
|
import { Colors } from '../Consts';
|
|
@@ -156,6 +156,7 @@ const Text: React.FC<TextProps> = ({
|
|
|
156
156
|
...rest
|
|
157
157
|
}) => {
|
|
158
158
|
const { theme } = useContext(ApplicationContext);
|
|
159
|
+
const context = useContext<any>(MiniAppContext);
|
|
159
160
|
const skeleton = useContext(SkeletonContext);
|
|
160
161
|
const textStyle = TypoStyles(typography, fontFamily, maxScaleRate);
|
|
161
162
|
|
|
@@ -165,6 +166,16 @@ const Text: React.FC<TextProps> = ({
|
|
|
165
166
|
);
|
|
166
167
|
}
|
|
167
168
|
|
|
169
|
+
// config baseline enabled
|
|
170
|
+
const isDebugBaseline = context?.isBaselineEnabled ?? false;
|
|
171
|
+
|
|
172
|
+
const baseLineStyle = isDebugBaseline
|
|
173
|
+
? {
|
|
174
|
+
borderWidth: 1,
|
|
175
|
+
borderColor: Colors.green_06,
|
|
176
|
+
}
|
|
177
|
+
: {};
|
|
178
|
+
|
|
168
179
|
if (skeleton.loading) {
|
|
169
180
|
return (
|
|
170
181
|
<View style={style}>
|
|
@@ -192,10 +203,9 @@ const Text: React.FC<TextProps> = ({
|
|
|
192
203
|
style={[
|
|
193
204
|
style,
|
|
194
205
|
textStyle,
|
|
206
|
+
baseLineStyle,
|
|
195
207
|
{
|
|
196
208
|
color: color ?? theme.colors.text.default,
|
|
197
|
-
borderWidth: 1,
|
|
198
|
-
borderColor: Colors.green_06,
|
|
199
209
|
},
|
|
200
210
|
]}
|
|
201
211
|
>
|