diff --git a/src/styles/variables.js b/src/styles/variables.ts similarity index 97% rename from src/styles/variables.js rename to src/styles/variables.ts index 40e29ca3cf6e..168282829ba0 100644 --- a/src/styles/variables.js +++ b/src/styles/variables.ts @@ -6,11 +6,8 @@ import {PixelRatio} from 'react-native'; * This means that if you have text and its 'fontSize' is 19, the device font size changed to the 5th level on the iOS slider and the actual fontSize is 19 * PixelRatio.getFontScale() * = 19 * 1.11 = 21.09. Since we are disallowing font scaling we need to calculate it manually. We calculate it with: PixelRatio.getFontScale() * defaultValue > maxValue ? maxValue : * defaultValue * PixelRatio getFontScale() This means that the fontSize is increased/decreased when the device font size changes up to maxValue (second param) - * @param {Number} defaultValue - * @param {Number} maxValue - * @returns {Number} */ -function getValueUsingPixelRatio(defaultValue, maxValue) { +function getValueUsingPixelRatio(defaultValue: number, maxValue: number): number { return PixelRatio.getFontScale() * defaultValue > maxValue ? maxValue : defaultValue * PixelRatio.getFontScale(); } @@ -154,4 +151,4 @@ export default { qrShareHorizontalPadding: 32, baseMenuItemHeight: 64, -}; +} as const;