@pspatel/react-native-app-intro
Version:
A fully customizable React Native component aimed to beautify onboarding experience
17 lines (13 loc) • 425 B
text/typescript
import { Dimensions, PixelRatio } from "react-native";
export const screenWidth = Dimensions.get("window").width;
export const screenHeight = Dimensions.get("window").height;
const scale = screenWidth / 320;
export const normalize = (size: number) => {
const newSize: number = size * scale;
return Math.round(PixelRatio.roundToNearestPixel(newSize));
};
export default {
screenWidth,
screenHeight,
normalize,
};