@momo-kits/foundation 0.80.8-beta.14 → 0.80.8-beta.15
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.tsx +6 -2
- package/Layout/Screen.tsx +13 -11
- package/Layout/styles.ts +0 -2
- package/package.json +1 -1
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
import {scaleSize, Text} from '../Text';
|
|
24
24
|
import {Icon} from '../Icon';
|
|
25
25
|
import {PopupNotify} from '../Popup';
|
|
26
|
-
import Carousel from '@momo-kits/carousel';
|
|
27
26
|
|
|
28
27
|
const Touchable =
|
|
29
28
|
Platform.OS === 'android' ? TouchableGesture : TouchableOpacity;
|
|
@@ -432,6 +431,11 @@ const HeaderAnimated: React.FC<HeaderAnimatedProps> = ({
|
|
|
432
431
|
outputRange: [1, 0.5, 0],
|
|
433
432
|
extrapolate: 'clamp',
|
|
434
433
|
});
|
|
434
|
+
const translateY = animatedValue.interpolate({
|
|
435
|
+
inputRange: [-300, 0],
|
|
436
|
+
outputRange: [-160, -2],
|
|
437
|
+
extrapolate: 'clamp',
|
|
438
|
+
});
|
|
435
439
|
|
|
436
440
|
return (
|
|
437
441
|
<TouchableOpacity onPress={onPress}>
|
|
@@ -439,7 +443,7 @@ const HeaderAnimated: React.FC<HeaderAnimatedProps> = ({
|
|
|
439
443
|
style={{
|
|
440
444
|
aspectRatio: 1.75,
|
|
441
445
|
opacity: opacity,
|
|
442
|
-
transform: [{scale
|
|
446
|
+
transform: [{scale}, {translateY}],
|
|
443
447
|
}}>
|
|
444
448
|
<Image
|
|
445
449
|
source={{
|
package/Layout/Screen.tsx
CHANGED
|
@@ -69,14 +69,14 @@ export interface ScreenProps extends ViewProps {
|
|
|
69
69
|
footerComponent?: ReactNode;
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
* Optional.
|
|
72
|
+
* Optional. Background color of the screen.
|
|
73
73
|
*/
|
|
74
|
-
|
|
74
|
+
backgroundColor?: string;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
|
-
* Optional.
|
|
77
|
+
* Optional. layout card offset overlap header banner.
|
|
78
78
|
*/
|
|
79
|
-
|
|
79
|
+
layoutOffset?: -8 | -24 | -56;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
const Screen = forwardRef(
|
|
@@ -86,12 +86,13 @@ const Screen = forwardRef(
|
|
|
86
86
|
enableKeyboardAvoidingView = false,
|
|
87
87
|
scrollable = false,
|
|
88
88
|
navigation,
|
|
89
|
-
|
|
89
|
+
|
|
90
90
|
useExtendedHeader,
|
|
91
91
|
animatedHeader,
|
|
92
92
|
scrollViewProps,
|
|
93
93
|
headerComponent: Header,
|
|
94
94
|
footerComponent: Footer,
|
|
95
|
+
layoutOffset = -56,
|
|
95
96
|
backgroundColor,
|
|
96
97
|
}: ScreenProps,
|
|
97
98
|
ref,
|
|
@@ -99,16 +100,13 @@ const Screen = forwardRef(
|
|
|
99
100
|
const animatedValue = useRef<Animated.Value | undefined>(undefined);
|
|
100
101
|
const {theme} = useContext(ApplicationContext);
|
|
101
102
|
const insets = useSafeAreaInsets();
|
|
103
|
+
const heightHeader = useHeaderHeight();
|
|
102
104
|
|
|
103
105
|
let handleScroll;
|
|
104
106
|
let headerBackground: string | undefined = undefined;
|
|
105
107
|
let Component: any = View;
|
|
106
108
|
animatedValue.current = undefined;
|
|
107
109
|
|
|
108
|
-
if (useExtendedHeader || animatedHeader) {
|
|
109
|
-
marginHeader = marginHeader ?? useHeaderHeight();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
110
|
if (useExtendedHeader) {
|
|
113
111
|
headerBackground = theme.assets?.headerBackground;
|
|
114
112
|
}
|
|
@@ -239,9 +237,8 @@ const Screen = forwardRef(
|
|
|
239
237
|
<View
|
|
240
238
|
style={[Styles.flex, {backgroundColor}]}
|
|
241
239
|
accessibilityLabel={`ScreenContainer`}>
|
|
242
|
-
<View style={styles.screenBanner}>{renderHeader()}</View>
|
|
243
240
|
<KeyboardAvoidingView
|
|
244
|
-
style={
|
|
241
|
+
style={Styles.flex}
|
|
245
242
|
enabled={enableKeyboardAvoidingView}
|
|
246
243
|
behavior={Platform.select({
|
|
247
244
|
ios: 'padding',
|
|
@@ -251,9 +248,14 @@ const Screen = forwardRef(
|
|
|
251
248
|
<Component
|
|
252
249
|
{...scrollViewProps}
|
|
253
250
|
ref={ref}
|
|
251
|
+
heightHeader={heightHeader}
|
|
254
252
|
showsVerticalScrollIndicator={false}
|
|
255
253
|
onScroll={handleScroll}
|
|
256
254
|
style={Styles.flex}>
|
|
255
|
+
<View
|
|
256
|
+
style={[styles.screenBanner, {maxHeight: 215 + layoutOffset}]}>
|
|
257
|
+
{renderHeader()}
|
|
258
|
+
</View>
|
|
257
259
|
{renderContent()}
|
|
258
260
|
</Component>
|
|
259
261
|
{Footer && (
|
package/Layout/styles.ts
CHANGED