@momo-kits/foundation 0.168.1-beta.23 → 0.168.1-beta.24
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/BottomSheet.tsx +16 -3
- package/package.json +1 -1
|
@@ -53,6 +53,8 @@ const DUO_ORIENTATIONS = ['portrait', 'landscape'];
|
|
|
53
53
|
const SIDE_COLUMN_OFFSET =
|
|
54
54
|
INDICATOR_HEIGHT + (HEADER_HEIGHT - DuoMetrics.controlSize) / 2;
|
|
55
55
|
|
|
56
|
+
const getSideInset = (inset: number) => Math.max(inset - Spacing.M, 0);
|
|
57
|
+
|
|
56
58
|
const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
57
59
|
const { theme, navigator } = useContext(ApplicationContext);
|
|
58
60
|
const context = useContext<any>(MiniAppContext);
|
|
@@ -83,6 +85,9 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
83
85
|
: getDuoTopInset(insets, windowSize.width, windowSize.height),
|
|
84
86
|
Spacing.XL,
|
|
85
87
|
);
|
|
88
|
+
const sideInsetLeft = isDuoFloating ? getSideInset(insets.left) : 0;
|
|
89
|
+
const sideInsetRight = isDuoFloating ? getSideInset(insets.right) : 0;
|
|
90
|
+
const indicatorShift = (sideInsetRight - sideInsetLeft) / 2;
|
|
86
91
|
const isIOS = Platform.OS === 'ios';
|
|
87
92
|
const bottomInset = isIOS ? Math.min(insets.bottom, 21) : insets.bottom;
|
|
88
93
|
const keyboardOffset = heightHeader - bottomInset;
|
|
@@ -289,7 +294,14 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
289
294
|
return (
|
|
290
295
|
<View {...panResponder.panHandlers}>
|
|
291
296
|
<View style={{ height: INDICATOR_HEIGHT }}>
|
|
292
|
-
<View
|
|
297
|
+
<View
|
|
298
|
+
style={[
|
|
299
|
+
styles.indicator,
|
|
300
|
+
indicatorShift !== 0 && {
|
|
301
|
+
transform: [{ translateX: indicatorShift }],
|
|
302
|
+
},
|
|
303
|
+
]}
|
|
304
|
+
/>
|
|
293
305
|
</View>
|
|
294
306
|
<View
|
|
295
307
|
style={[
|
|
@@ -337,6 +349,7 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
337
349
|
}, [
|
|
338
350
|
hasSideColumn,
|
|
339
351
|
iconBack,
|
|
352
|
+
indicatorShift,
|
|
340
353
|
leftOptions,
|
|
341
354
|
onPressBack,
|
|
342
355
|
onPressClose,
|
|
@@ -401,8 +414,8 @@ const BottomSheet: React.FC<BottomSheetParams> = props => {
|
|
|
401
414
|
});
|
|
402
415
|
|
|
403
416
|
const sideInsetStyle = isDuoFloating && {
|
|
404
|
-
paddingLeft:
|
|
405
|
-
paddingRight:
|
|
417
|
+
paddingLeft: sideInsetLeft,
|
|
418
|
+
paddingRight: sideInsetRight,
|
|
406
419
|
};
|
|
407
420
|
|
|
408
421
|
const screen = (
|