@momo-kits/foundation 0.154.1-beta.6 → 0.154.1-beta.8
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,8 +40,6 @@ const NavigationContainer: React.FC<NavigationContainerProps> = ({
|
|
|
40
40
|
enableHapticDialog: true,
|
|
41
41
|
enableForceFoundationList: false,
|
|
42
42
|
enableHapticBottomTab: true,
|
|
43
|
-
scaleSizeMaxRate: 1.5,
|
|
44
|
-
showBaseLineDebug: false,
|
|
45
43
|
},
|
|
46
44
|
}) => {
|
|
47
45
|
const context = useContext<any>(MiniAppContext);
|
package/Text/utils.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Dimensions, PixelRatio, useWindowDimensions } from 'react-native';
|
|
2
2
|
import { useContext } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ScaleSizeContext } from '../Context';
|
|
4
4
|
|
|
5
5
|
const deviceWidth = Dimensions.get('window').width;
|
|
6
6
|
const DEFAULT_SCREEN_SIZE = 375;
|
|
@@ -8,17 +8,13 @@ const MAX_FONT_SCALE = 1.5;
|
|
|
8
8
|
const MAX_DEVICE_SCALE = 5;
|
|
9
9
|
|
|
10
10
|
const useScaleSize = (size: number, scaleRate?: number) => {
|
|
11
|
-
const context = useContext<any>(MiniAppContext);
|
|
12
11
|
const scaleSizeContext = useContext<any>(ScaleSizeContext);
|
|
13
12
|
const fontScale = PixelRatio.getFontScale();
|
|
14
13
|
const windowSize = useWindowDimensions();
|
|
15
14
|
const deviceScale = windowSize.width / DEFAULT_SCREEN_SIZE;
|
|
16
15
|
|
|
17
16
|
const maxScaleRate =
|
|
18
|
-
scaleRate ||
|
|
19
|
-
scaleSizeContext?.scaleSizeMaxRate ||
|
|
20
|
-
context?.features?.scaleSizeMaxRate ||
|
|
21
|
-
MAX_FONT_SCALE;
|
|
17
|
+
scaleRate || scaleSizeContext?.scaleSizeMaxRate || MAX_FONT_SCALE;
|
|
22
18
|
|
|
23
19
|
let fontSizeDeviceScale = size;
|
|
24
20
|
let fontSizeOSScale = size;
|