import { Dimensions, useWindowDimensions } from 'react-native';

const { width, height } = Dimensions.get('window');

const guidelineBaseWidth = 375;
const guidelineBaseHeight = 812;

/*

Use HorizontalScale for width, marginLeft, marginRight, paddingLeft,paddingRight,
paddingHorizontal, likewise

Use VerticalScale for width, marginTop, marginBottom, marginVertical, line-height,paddingTop, paddingBottom,paddingVertical, likewise

Use ModerateScale for font-size, borderRadius , likewise

*/

const screenWidth =  width < height ? width : height
const screenHeight = width < height ? height: width

const horizontalScale = (size) => (screenWidth / guidelineBaseWidth) * size;
const verticalScale = (size) => (screenHeight / guidelineBaseHeight) * size;
const moderateScale = (size, factor = 0.5) => size + (horizontalScale(size) - size) * factor;

export { horizontalScale, verticalScale, moderateScale, screenHeight,screenWidth};