@momo-kits/foundation 0.110.1-beta.3 → 0.110.1-beta.4

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.
@@ -35,7 +35,8 @@ const HeaderAnimated: React.FC<HeaderAnimatedProps> = ({
35
35
  return (
36
36
  <Animated.View
37
37
  style={{
38
- height: 210,
38
+ width: '100%',
39
+ aspectRatio: 16 / 9,
39
40
  opacity: opacity,
40
41
  transform: [{scale}, {translateY}],
41
42
  }}>
@@ -72,9 +72,8 @@ const TitleUser: React.FC<TitleUserProps> = ({
72
72
  image,
73
73
  tintColor,
74
74
  dotColor,
75
+ verify,
75
76
  onPress,
76
- icon1,
77
- icon2,
78
77
  }) => {
79
78
  const {theme} = useContext(ApplicationContext);
80
79
  const getShortName = (name: string) => {
@@ -84,7 +83,7 @@ const TitleUser: React.FC<TitleUserProps> = ({
84
83
  };
85
84
 
86
85
  const renderImage = () => {
87
- if (image) {
86
+ if (!!image) {
88
87
  return <Image source={{uri: image}} style={styles.circle} />;
89
88
  } else {
90
89
  return (
@@ -95,36 +94,6 @@ const TitleUser: React.FC<TitleUserProps> = ({
95
94
  }
96
95
  };
97
96
 
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
-
128
97
  return (
129
98
  <TouchableOpacity
130
99
  style={styles.headerTitleContainer}
@@ -150,8 +119,15 @@ const TitleUser: React.FC<TitleUserProps> = ({
150
119
  color={tintColor}
151
120
  numberOfLines={1}>
152
121
  {title}
153
- </Text>
154
- {renderVerifyIcon()}
122
+ </Text>
123
+ {verify && (
124
+ <Image
125
+ source={{
126
+ uri: 'https://static.momocdn.net/app/img/kits/verified.png',
127
+ }}
128
+ style={styles.verifiedIcon}
129
+ />
130
+ )}
155
131
  </View>
156
132
  {!!subTitle && (
157
133
  <Text
@@ -315,7 +291,7 @@ const styles = StyleSheet.create({
315
291
  borderWidth: 2,
316
292
  borderColor: Colors.black_01,
317
293
  },
318
- verifiedIcon: {width: 16, height: 16, marginLeft: Spacing.XS},
294
+ verifiedIcon: {width: 12, height: 12, marginLeft: Spacing.XS},
319
295
  });
320
296
 
321
297
  export {HeaderTitle, TitleCustom};
@@ -32,6 +32,7 @@ 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(undefined);
35
36
 
36
37
  /**
37
38
  * inject data for navigator
@@ -62,12 +63,27 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
62
63
  return localize?.translate(data as string);
63
64
  };
64
65
 
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
+
65
76
  return (
66
77
  <SafeAreaProvider>
67
78
  <ApplicationContext.Provider
68
79
  value={{
69
80
  navigator: navigator.current,
70
- theme,
81
+ theme: {
82
+ ...theme,
83
+ assets: {
84
+ headerBackground: theme.assets?.headerBackground || configHeader,
85
+ },
86
+ },
71
87
  showGrid,
72
88
  translate,
73
89
  }}>
@@ -198,8 +198,6 @@ export type TitleUserProps = {
198
198
  verify?: boolean;
199
199
  tintColor?: string;
200
200
  onPress?: () => void;
201
- icon1?: string;
202
- icon2?: string;
203
201
  };
204
202
 
205
203
  export type TitleLocationProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.110.1-beta.3",
3
+ "version": "0.110.1-beta.4",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},