@momo-kits/foundation 0.109.1-beta.0 → 0.109.1-beta.2

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.
@@ -40,7 +40,7 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
40
40
  <Animated.View
41
41
  style={[
42
42
  Styles.flex,
43
- useShadowHeader && styles.shadowHeader,
43
+ useShadowHeader ? styles.shadowHeader : styles.dividerHeader,
44
44
  {
45
45
  backgroundColor: theme.colors.background.surface,
46
46
  opacity: opacityBackground,
@@ -107,6 +107,10 @@ const styles = StyleSheet.create({
107
107
  position: 'absolute',
108
108
  aspectRatio: 375 / 154,
109
109
  },
110
+ dividerHeader: {
111
+ borderBottomWidth: 1,
112
+ borderColor: Colors.black_04,
113
+ },
110
114
  });
111
115
 
112
116
  export {HeaderBackground};
@@ -5,7 +5,7 @@ import {Animated, Dimensions, Platform, StyleSheet, View} from 'react-native';
5
5
  import {HeaderType} from '../../Layout/types';
6
6
  import {InputRef, InputSearch, InputSearchProps} from '../../Input';
7
7
  import Navigation from '../Navigation';
8
- import {Colors, Radius, Spacing, Styles} from '../../Consts';
8
+ import {Colors, Radius, Spacing} from '../../Consts';
9
9
  import {Image} from '../../Image';
10
10
 
11
11
  const SCREEN_PADDING = 12;
@@ -82,12 +82,47 @@ const HeaderExtendHeader: React.FC<{
82
82
  });
83
83
 
84
84
  if (inputSearchProps) {
85
- const renderInputView = () => {
86
- return (
85
+ return (
86
+ <>
87
+ <Animated.View style={{height: height}} />
88
+ <Animated.View
89
+ style={[
90
+ useShadowHeader ? styles.shadowHeader : styles.dividerHeader,
91
+ {
92
+ backgroundColor: theme.colors.background.surface,
93
+ opacity: opacityBackground,
94
+ position: 'absolute',
95
+ width: '100%',
96
+ height: heightHeader,
97
+ zIndex: 1,
98
+ },
99
+ ]}
100
+ />
101
+
102
+ <Animated.View
103
+ style={[
104
+ styles.headerBox,
105
+ {height: headerType === 'extended' ? height : heightHeader},
106
+ ]}>
107
+ <LinearGradientAnimated
108
+ colors={[theme.colors.gradient, theme.colors.gradient + '00']}
109
+ style={[styles.extendedHeader, {opacity: opacityGradient}]}>
110
+ {!!theme.assets?.headerBackground && (
111
+ <Image
112
+ style={styles.headerBackground}
113
+ source={{uri: theme.assets?.headerBackground}}
114
+ loading={false}
115
+ />
116
+ )}
117
+ </LinearGradientAnimated>
118
+ </Animated.View>
119
+
87
120
  <Animated.View
88
121
  style={{
89
122
  justifyContent: 'flex-end',
90
123
  height,
124
+ position: 'absolute',
125
+ zIndex: 2,
91
126
  }}>
92
127
  <Animated.View
93
128
  style={{
@@ -112,40 +147,6 @@ const HeaderExtendHeader: React.FC<{
112
147
  </Animated.View>
113
148
  </Animated.View>
114
149
  </Animated.View>
115
- );
116
- };
117
- return (
118
- <>
119
- <Animated.View
120
- style={[
121
- styles.headerBox,
122
- {height: headerType === 'extended' ? height : heightHeader},
123
- ]}>
124
- <Animated.View
125
- style={[
126
- Styles.flex,
127
- styles.shadowHeader,
128
- {
129
- borderBottomWidth: 1,
130
- borderColor: theme.colors.border.default,
131
- backgroundColor: theme.colors.background.surface,
132
- opacity: opacityBackground,
133
- },
134
- ]}
135
- />
136
- <LinearGradientAnimated
137
- colors={[theme.colors.gradient, theme.colors.gradient + '00']}
138
- style={[styles.extendedHeader, {opacity: opacityGradient}]}>
139
- {!!theme.assets?.headerBackground && (
140
- <Image
141
- style={styles.headerBackground}
142
- source={{uri: theme.assets?.headerBackground}}
143
- loading={false}
144
- />
145
- )}
146
- </LinearGradientAnimated>
147
- </Animated.View>
148
- {renderInputView()}
149
150
  <Verified />
150
151
  </>
151
152
  );
@@ -303,11 +303,6 @@ const styles = StyleSheet.create({
303
303
  position: 'absolute',
304
304
  width: '100%',
305
305
  },
306
- headerBox: {
307
- width: '100%',
308
- position: 'absolute',
309
- overflow: 'hidden',
310
- },
311
306
  verifiedDot: {
312
307
  width: 4,
313
308
  height: 4,
@@ -1,5 +1,11 @@
1
1
  import React, {useContext} from 'react';
2
- import {Animated, StyleSheet, TouchableOpacity, View} from 'react-native';
2
+ import {
3
+ Animated,
4
+ Dimensions,
5
+ StyleSheet,
6
+ TouchableOpacity,
7
+ View,
8
+ } from 'react-native';
3
9
  import {ApplicationContext, MiniAppContext} from '../index';
4
10
  import {scaleSize, Text} from '../../Text';
5
11
  import {Colors, Spacing, Styles} from '../../Consts';
@@ -227,7 +233,7 @@ const styles = StyleSheet.create({
227
233
  headerTitleContainer: {
228
234
  alignItems: 'center',
229
235
  justifyContent: 'center',
230
- width: '70%',
236
+ width: Dimensions.get('window').width - 170,
231
237
  },
232
238
  circle: {
233
239
  width: 32,
@@ -158,17 +158,7 @@ const exportHeaderTitle = (
158
158
  },
159
159
  };
160
160
  } else if (typeof params.headerTitle === 'string') {
161
- return {
162
- headerTitle: (props: any) => {
163
- return (
164
- <HeaderTitle
165
- {...props}
166
- children={params.headerTitle}
167
- animatedValue={animatedValue}
168
- />
169
- );
170
- },
171
- };
161
+ delete params.headerTitle;
172
162
  }
173
163
  return {};
174
164
  };
package/Layout/Screen.tsx CHANGED
@@ -175,9 +175,10 @@ const Screen = forwardRef(
175
175
 
176
176
  let handleScroll;
177
177
  let Component: any = View;
178
- let keyboardOffset = heightHeader - 20;
178
+
179
+ let keyboardOffset = heightHeader - Math.min(insets.bottom, 21);
179
180
  if (headerType === 'extended' || animatedHeader || inputSearchProps) {
180
- keyboardOffset = -20;
181
+ keyboardOffset = -Math.min(insets.bottom, 21);
181
182
  }
182
183
 
183
184
  /**
@@ -342,7 +343,7 @@ const Screen = forwardRef(
342
343
  } else {
343
344
  setHeaderType(headerType);
344
345
  }
345
- }, [headerType, animatedHeader, inputSearchProps]);
346
+ }, [headerType, animatedHeader, inputSearchProps, useShadowHeader]);
346
347
 
347
348
  /**
348
349
  * expose ref for screen
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/foundation",
3
- "version": "0.109.1-beta.0",
3
+ "version": "0.109.1-beta.2",
4
4
  "description": "React Native Component Kits",
5
5
  "main": "index.ts",
6
6
  "scripts": {},