@momo-kits/foundation 0.110.1-beta.2 → 0.110.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.
|
@@ -72,8 +72,9 @@ const TitleUser: React.FC<TitleUserProps> = ({
|
|
|
72
72
|
image,
|
|
73
73
|
tintColor,
|
|
74
74
|
dotColor,
|
|
75
|
-
verify,
|
|
76
75
|
onPress,
|
|
76
|
+
icon1,
|
|
77
|
+
icon2,
|
|
77
78
|
}) => {
|
|
78
79
|
const {theme} = useContext(ApplicationContext);
|
|
79
80
|
const getShortName = (name: string) => {
|
|
@@ -83,7 +84,7 @@ const TitleUser: React.FC<TitleUserProps> = ({
|
|
|
83
84
|
};
|
|
84
85
|
|
|
85
86
|
const renderImage = () => {
|
|
86
|
-
if (
|
|
87
|
+
if (image) {
|
|
87
88
|
return <Image source={{uri: image}} style={styles.circle} />;
|
|
88
89
|
} else {
|
|
89
90
|
return (
|
|
@@ -94,6 +95,36 @@ const TitleUser: React.FC<TitleUserProps> = ({
|
|
|
94
95
|
}
|
|
95
96
|
};
|
|
96
97
|
|
|
98
|
+
const renderVerifyIcon = () => {
|
|
99
|
+
if (icon1 && icon2) {
|
|
100
|
+
return (
|
|
101
|
+
<View style={Styles.row}>
|
|
102
|
+
<Image
|
|
103
|
+
source={{
|
|
104
|
+
uri: icon1,
|
|
105
|
+
}}
|
|
106
|
+
style={styles.verifiedIcon}
|
|
107
|
+
/>
|
|
108
|
+
<Image
|
|
109
|
+
source={{
|
|
110
|
+
uri: icon2,
|
|
111
|
+
}}
|
|
112
|
+
style={styles.verifiedIcon}
|
|
113
|
+
/>
|
|
114
|
+
</View>
|
|
115
|
+
);
|
|
116
|
+
} else if (icon1 || icon2) {
|
|
117
|
+
return (
|
|
118
|
+
<Image
|
|
119
|
+
source={{
|
|
120
|
+
uri: icon1 || icon2,
|
|
121
|
+
}}
|
|
122
|
+
style={styles.verifiedIcon}
|
|
123
|
+
/>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
|
|
97
128
|
return (
|
|
98
129
|
<TouchableOpacity
|
|
99
130
|
style={styles.headerTitleContainer}
|
|
@@ -119,15 +150,8 @@ const TitleUser: React.FC<TitleUserProps> = ({
|
|
|
119
150
|
color={tintColor}
|
|
120
151
|
numberOfLines={1}>
|
|
121
152
|
{title}
|
|
122
|
-
</Text>
|
|
123
|
-
{
|
|
124
|
-
<Image
|
|
125
|
-
source={{
|
|
126
|
-
uri: 'https://static.momocdn.net/app/img/kits/verified.png',
|
|
127
|
-
}}
|
|
128
|
-
style={styles.verifiedIcon}
|
|
129
|
-
/>
|
|
130
|
-
)}
|
|
153
|
+
</Text>
|
|
154
|
+
{renderVerifyIcon()}
|
|
131
155
|
</View>
|
|
132
156
|
{!!subTitle && (
|
|
133
157
|
<Text
|
|
@@ -291,7 +315,7 @@ const styles = StyleSheet.create({
|
|
|
291
315
|
borderWidth: 2,
|
|
292
316
|
borderColor: Colors.black_01,
|
|
293
317
|
},
|
|
294
|
-
verifiedIcon: {width:
|
|
318
|
+
verifiedIcon: {width: 16, height: 16, marginLeft: Spacing.XS},
|
|
295
319
|
});
|
|
296
320
|
|
|
297
321
|
export {HeaderTitle, TitleCustom};
|
|
@@ -32,7 +32,6 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
|
32
32
|
const isReady = useRef(false);
|
|
33
33
|
const navigator = useRef(new Navigator(navigationRef, isReady));
|
|
34
34
|
const [showGrid, setShowGrid] = useState(false);
|
|
35
|
-
const [configHeader, setConfigHeader] = useState(null);
|
|
36
35
|
|
|
37
36
|
/**
|
|
38
37
|
* inject data for navigator
|
|
@@ -63,27 +62,12 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
|
63
62
|
return localize?.translate(data as string);
|
|
64
63
|
};
|
|
65
64
|
|
|
66
|
-
useEffect(() => {
|
|
67
|
-
maxApi?.getFeatureById('platform_config', (data: any) => {
|
|
68
|
-
const parsedConfig = JSON.parse(data?.param);
|
|
69
|
-
const header = parsedConfig?.navigationBar?.headerBar;
|
|
70
|
-
if (header) {
|
|
71
|
-
setConfigHeader(header);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}, []);
|
|
75
|
-
|
|
76
65
|
return (
|
|
77
66
|
<SafeAreaProvider>
|
|
78
67
|
<ApplicationContext.Provider
|
|
79
68
|
value={{
|
|
80
69
|
navigator: navigator.current,
|
|
81
|
-
theme
|
|
82
|
-
...theme,
|
|
83
|
-
assets: {
|
|
84
|
-
headerBackground: theme.assets?.headerBackground || configHeader,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
70
|
+
theme,
|
|
87
71
|
showGrid,
|
|
88
72
|
translate,
|
|
89
73
|
}}>
|
package/Application/types.ts
CHANGED