Procházet zdrojové kódy

feat: adaptive font size

Oleksandr Honcharov před 1 rokem
rodič
revize
223c8bb566
2 změnil soubory, kde provedl 5 přidání a 0 odebrání
  1. 1 0
      src/utils/index.ts
  2. 4 0
      src/utils/responsive-font.ts

+ 1 - 0
src/utils/index.ts

@@ -1 +1,2 @@
 export * from './request';
+export * from './responsive-font';

+ 4 - 0
src/utils/responsive-font.ts

@@ -0,0 +1,4 @@
+import { PixelRatio } from 'react-native';
+
+const fontScale = PixelRatio.getFontScale();
+export const getFontSize = (size: number) => size / fontScale;