49 lines
989 B
JavaScript
49 lines
989 B
JavaScript
|
import React from 'react';
|
||
|
import PropTypes from 'prop-types';
|
||
|
import { Dimensions, Text, StyleSheet } from 'react-native';
|
||
|
const { width, height } = Dimensions.get('window');
|
||
|
const flattenStyle = StyleSheet.flatten;
|
||
|
const realWidth = height > width ? width : height;
|
||
|
|
||
|
export default class Size{
|
||
|
|
||
|
getSize(size){
|
||
|
return Math.round(size * realWidth / 375);
|
||
|
}
|
||
|
|
||
|
status(value){
|
||
|
switch(value){
|
||
|
case 'A':
|
||
|
return 'Not pay yet'
|
||
|
break;
|
||
|
|
||
|
case 'V':
|
||
|
return 'Cancelled'
|
||
|
break;
|
||
|
|
||
|
case 'I':
|
||
|
return 'Cancel by unpaid'
|
||
|
break;
|
||
|
|
||
|
case 'E':
|
||
|
return 'Expired by unpaid'
|
||
|
break;
|
||
|
|
||
|
case 'P':
|
||
|
return 'Preparing'
|
||
|
break;
|
||
|
|
||
|
case 'D':
|
||
|
return 'ready'
|
||
|
break;
|
||
|
|
||
|
case 'F':
|
||
|
return 'Completed'
|
||
|
break;
|
||
|
|
||
|
default:
|
||
|
return 'Undefind'
|
||
|
break
|
||
|
}
|
||
|
}
|
||
|
}
|