Commit 080112fa by Giang Tran

update code

parent e87affda
...@@ -6,4 +6,5 @@ import {AppRegistry} from 'react-native'; ...@@ -6,4 +6,5 @@ import {AppRegistry} from 'react-native';
import App from './App'; import App from './App';
import {name as appName} from './app.json'; import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App); AppRegistry.registerComponent(appName, () => App);
...@@ -97,7 +97,7 @@ const Profile = (props) => { ...@@ -97,7 +97,7 @@ const Profile = (props) => {
const res = await uploadImage( const res = await uploadImage(
createFormData(urlBack, { createFormData(urlBack, {
scope: 'VERIFY_USER', scope: 'VERIFY_USER',
field_name: 'identity_before', field_name: 'identity_after',
platform: Platform.OS, platform: Platform.OS,
}), }),
); );
......
...@@ -25,8 +25,8 @@ import RadioForm, { ...@@ -25,8 +25,8 @@ import RadioForm, {
} from 'react-native-simple-radio-button'; } from 'react-native-simple-radio-button';
var radio_props = [ var radio_props = [
{label: 'Mua', value: 0}, {label: 'Mua', value: 'BUY'},
{label: 'Bán', value: 1}, {label: 'Bán', value: 'SALE'},
]; ];
const dataType = [ const dataType = [
...@@ -45,13 +45,18 @@ const {width} = Dimensions.get('window'); ...@@ -45,13 +45,18 @@ const {width} = Dimensions.get('window');
const CaculatedStopLoss = (props) => { const CaculatedStopLoss = (props) => {
const [product, setProduct] = useState(); const [product, setProduct] = useState();
const [type, setType] = useState('BUY'); const [type, setType] = useState('BUY');
const [lot, setLot] = useState('BUY'); const [lot, setLot] = useState(0);
const [priceOpen, setPriceOpen] = useState(525); const [priceOpen, setPriceOpen] = useState(0);
const [fee, setFee] = useState(0); const [fee, setFee] = useState(0);
const [surplus, setSurplus] = useState(0); const [surplus, setSurplus] = useState(0);
const [inSession, setInSession] = useState(0); const [inSession, setInSession] = useState(0);
const [priceClose, setPriceClose] = useState(525); const [priceClose, setPriceClose] = useState(0);
const [priceSopLoss, setPriceSopLoss] = useState(0);
const onClick = () => {
console.log('hello');
};
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
...@@ -71,7 +76,6 @@ const CaculatedStopLoss = (props) => { ...@@ -71,7 +76,6 @@ const CaculatedStopLoss = (props) => {
setProduct(items); setProduct(items);
}} }}
/> />
<AppText style={styles.txtTitle} i18nKey={'Tradding'} /> <AppText style={styles.txtTitle} i18nKey={'Tradding'} />
<RadioForm <RadioForm
formHorizontal={true} formHorizontal={true}
...@@ -80,19 +84,47 @@ const CaculatedStopLoss = (props) => { ...@@ -80,19 +84,47 @@ const CaculatedStopLoss = (props) => {
style={styles.row} style={styles.row}
initial={0} initial={0}
onPress={(value) => { onPress={(value) => {
console.log({value: value}); setType(value);
}} }}
/> />
<TextField title={I18n.t('CountLotTradding')} /> <TextField
<TextField title={I18n.t('PriceOpen')} /> onChangeText={(val) => setLot(val)}
<TextField title={I18n.t('FeeTradding')} /> isNumber={true}
<TextField title={I18n.t('SurpusInit')} /> title={I18n.t('CountLotTradding')}
<TextField title={I18n.t('withdrawalsSession')} /> />
<TextField title={I18n.t('PriceClose')} /> <TextField
<TextField title={I18n.t('PriceStopLoss')} /> onChangeText={(val) => setPriceOpen(val)}
isNumber={true}
title={I18n.t('PriceOpen')}
/>
<TextField
onChangeText={(val) => setFee(val)}
isNumber={true}
title={I18n.t('FeeTradding')}
/>
<TextField
onChangeText={(val) => setSurplus(val)}
isNumber={true}
title={I18n.t('SurpusInit')}
/>
<TextField
onChangeText={(val) => setInSession(val)}
isNumber={true}
title={I18n.t('withdrawalsSession')}
/>
<TextField
onChangeText={(val) => setPriceClose(val)}
isNumber={true}
title={I18n.t('PriceClose')}
/>
<TextField
onChangeText={(val) => setPriceSopLoss(val)}
isNumber={true}
title={I18n.t('PriceStopLoss')}
/>
<AppText style={styles.note} i18nKey={'noteStopLoss'} /> <AppText style={styles.note} i18nKey={'noteStopLoss'} />
<View style={styles.footer}> <View style={styles.footer}>
<TouchableOpacity style={styles.btnContainer}> <TouchableOpacity onPress={onClick} style={styles.btnContainer}>
<AppText style={styles.txtBtn} i18nKey={'Caculate'} /> <AppText style={styles.txtBtn} i18nKey={'Caculate'} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
......
...@@ -27,7 +27,15 @@ const dataType = [ ...@@ -27,7 +27,15 @@ const dataType = [
]; ];
const ConvertUnit = (props) => { const ConvertUnit = (props) => {
const [product, setProduct] = useState(); const [typeOne, setTypeOne] = useState();
const [typeTwo, setTypeTwo] = useState();
const [valueOne, setValueOne] = useState();
const [valueTwo, setValueTwo] = useState();
const onClick = () => {
console.log('Heloo', typeOne, typeTwo, valueOne, valueTwo);
};
return ( return (
<View style={{flex: 1}}> <View style={{flex: 1}}>
<HeaderBack title={'ConvertUnit'} /> <HeaderBack title={'ConvertUnit'} />
...@@ -39,10 +47,14 @@ const ConvertUnit = (props) => { ...@@ -39,10 +47,14 @@ const ConvertUnit = (props) => {
width={WIDTHXD(431)} width={WIDTHXD(431)}
data={dataType} data={dataType}
onValueChange={(value, items) => { onValueChange={(value, items) => {
setProduct(items); setTypeOne(items);
}} }}
/> />
<TextInput keyboardType={'number-pad'} style={styles.wrapInput} /> <TextInput
onChangeText={(val) => setValueOne(val)}
keyboardType={'number-pad'}
style={styles.wrapInput}
/>
</View> </View>
<Text style={styles.txtNote}>1KG = 2 Pount</Text> <Text style={styles.txtNote}>1KG = 2 Pount</Text>
</View> </View>
...@@ -53,16 +65,20 @@ const ConvertUnit = (props) => { ...@@ -53,16 +65,20 @@ const ConvertUnit = (props) => {
width={WIDTHXD(431)} width={WIDTHXD(431)}
data={dataType} data={dataType}
onValueChange={(value, items) => { onValueChange={(value, items) => {
setProduct(items); setTypeTwo(items);
}} }}
/> />
<TextInput keyboardType={'number-pad'} style={styles.wrapInput} /> <TextInput
onChangeText={(val) => setValueTwo(val)}
keyboardType={'number-pad'}
style={styles.wrapInput}
/>
</View> </View>
<Text style={styles.txtNote}>1 Pount = 0.5 KG</Text> <Text style={styles.txtNote}>1 Pount = 0.5 KG</Text>
</View> </View>
<View style={styles.footer}> <View style={styles.footer}>
<TouchableOpacity style={styles.btnContainer}> <TouchableOpacity onPress={onClick} style={styles.btnContainer}>
<AppText style={styles.txtBtn} i18nKey={'Caculate'} /> <AppText style={styles.txtBtn} i18nKey={'Caculate'} />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -75,7 +91,7 @@ const styles = StyleSheet.create({ ...@@ -75,7 +91,7 @@ const styles = StyleSheet.create({
txtTitle: { txtTitle: {
fontSize: getFontXD(42), fontSize: getFontXD(42),
color: R.colors.color777, color: R.colors.color777,
marginTop: 15, marginBottom: 15,
}, },
note: { note: {
fontSize: getFontXD(36), fontSize: getFontXD(36),
......
...@@ -257,4 +257,5 @@ export default { ...@@ -257,4 +257,5 @@ export default {
ConvertUSD: 'Quy đổi USD/Tấn', ConvertUSD: 'Quy đổi USD/Tấn',
Saturday: 'Thứ 7', Saturday: 'Thứ 7',
Sunday: 'Chủ nhật', Sunday: 'Chủ nhật',
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment