import { Dimensions, Platform, StatusBar } from 'react-native';
import * as utils from '../libs/Utils';

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

let statusBarHeight;
if (Platform.OS === 'android') statusBarHeight = StatusBar.currentHeight;
else if (utils.isIphoneX()) statusBarHeight = 30;
else statusBarHeight = 20;

// Used via Metrics.baseMargin
const metrics = {
  marginHorizontal: '10rem',
  sixteen: '16rem',
  thirtyTwo: '32rem',
  thirty: '30rem',
  eighteen: '18rem',
  sixty: '60rem',
  forty: '40rem',
  fifteen: '15rem',
  thirtyFive: '35rem',
  section: '25rem',
  fortyFive: '45rem',
  segmentHeight: '35rem',
  baseMargin: '10rem',
  doubleBaseMargin: '20rem',
  thirteen: '13rem',
  trippleBaseMargin: '30rem',
  smallMargin: '5rem',
  doubleSection: '50rem',
  horizontalLineHeight: '1rem',
  screenWidth: width < height ? width : height,
  screenHeight: width < height ? height : width,
  navBarHeight: Platform.OS === 'ios' ? '64rem' : '54rem',
  fontCorrection: '-4rem',
  icons: {
    tiny: '15rem',
    small: '20rem',
    medium: '30rem',
    large: '45rem',
    xl: '50rem'
  },
  images: {
    small: '20rem',
    medium: '40rem',
    large: '60rem',
    logo: '200rem'
  },
  isIphoneX: utils.isIphoneX(),
  statusBarHeight,
  deviceHeight: height,
  deviceWidth: width
};

export default metrics;
