Explorar o código

feat: adaptive font size

Oleksandr Honcharov hai 1 ano
pai
achega
223c8bb566
Modificáronse 2 ficheiros con 5 adicións e 0 borrados
  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;