@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.
- package/Application/Components/HeaderBackground.tsx +5 -1
- package/Application/Components/HeaderExtendHeader.tsx +38 -37
- package/Application/Components/HeaderRight.tsx +0 -5
- package/Application/Components/HeaderTitle.tsx +8 -2
- package/Application/utils.tsx +1 -11
- package/Layout/Screen.tsx +4 -3
- package/package.json +1 -1
|
@@ -40,7 +40,7 @@ const HeaderBackground: React.FC<HeaderBackgroundProps> = ({
|
|
|
40
40
|
<Animated.View
|
|
41
41
|
style={[
|
|
42
42
|
Styles.flex,
|
|
43
|
-
useShadowHeader
|
|
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
|
|
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
|
-
|
|
86
|
-
|
|
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
|
);
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React, {useContext} from 'react';
|
|
2
|
-
import {
|
|
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: '
|
|
236
|
+
width: Dimensions.get('window').width - 170,
|
|
231
237
|
},
|
|
232
238
|
circle: {
|
|
233
239
|
width: 32,
|
package/Application/utils.tsx
CHANGED
|
@@ -158,17 +158,7 @@ const exportHeaderTitle = (
|
|
|
158
158
|
},
|
|
159
159
|
};
|
|
160
160
|
} else if (typeof params.headerTitle === 'string') {
|
|
161
|
-
|
|
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
|
-
|
|
178
|
+
|
|
179
|
+
let keyboardOffset = heightHeader - Math.min(insets.bottom, 21);
|
|
179
180
|
if (headerType === 'extended' || animatedHeader || inputSearchProps) {
|
|
180
|
-
keyboardOffset = -
|
|
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
|