import { Platform, Dimensions } from 'react-native'; import { ifIphoneX } from 'react-native-iphone-x-helper' export function validateEmail(value) { const regex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return regex.test(value); } export function validatePassword(value) { // const regex = /^[\S]{8,32}$/; // const regex = /^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*)(?=.*[\.@#\$%\^&\*\(\)\[\]\\?\\\/\|\-~`\+\=\,\r\n\:\'\"]).{8,32}$/; const regex = /^(?=.*[0-9].*)(?=.*[A-Z].*)(?=.*[a-z].*).{8,}$/; return regex.test(value); } function getstatusBarHeight() { if (Platform.OS === 'ios') { return 20; } return 0; } const variables = { color: { primary: '#26B4FF', background: '#ECEDF0', info: '#46DFB7', error: '#E92A25', warn: '#FFC72F', border: '#E5E5E5', borderDark: '#d1d1d3', disabled: '#F5F5F5', disableBtn: '#969696', tipBackground: '#E7E9EC', white: '#fff', black: '#000000', line: '#CFCFCF', alphaWhite: 'rgba(255,255,255,0.6)', trendPath: '#63E2C7', trendArea: '#B9ECE2', trendValue: '#46DFB7', redButton: '#F44336', text: { primary: '#333', secondary: '#666', tip: '#999', placeholder: '#999', blue: '#009cff' } }, fontSize: { xxxlarge: 27, xxlarge: 19, xlarge: 18, large: 17, medium: 16, normal: 14, small: 13, tiny: 12, xsmall: 10, xxsmall: 8 }, fontWeight: { light: '300', normal: '400', bold: '700' }, height: { actionButton: 44, row: 45, largeRow: 55, doubleRow: 65, tripleRow: 85, narBar: Platform.OS === 'ios' ? 64 : 54, tabBar: 48, componentMargin: 19, componentMarginSmall: 9, statusBar: 20 }, margin: { horizontal: 15, vertical: 10 }, activeOpacity: 0.8, borderRadius: 5, commonGap: 4, commonGapBig: 12, commonMargin: 10, commonMarginTop: 35, statusBarHeight: getstatusBarHeight() + (ifIphoneX ? 18 : 0), screenWidth: Dimensions.get('window').width, screenHeight: Dimensions.get('window').height }; export default variables;