Commit 080112fa by Giang Tran

update code

parent e87affda
......@@ -6,4 +6,5 @@ import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App);
......@@ -97,7 +97,7 @@ const Profile = (props) => {
const res = await uploadImage(
createFormData(urlBack, {
scope: 'VERIFY_USER',
field_name: 'identity_before',
field_name: 'identity_after',
platform: Platform.OS,
}),
);
......
......@@ -25,8 +25,8 @@ import RadioForm, {
} from 'react-native-simple-radio-button';
var radio_props = [
{label: 'Mua', value: 0},
{label: 'Bán', value: 1},
{label: 'Mua', value: 'BUY'},
{label: 'Bán', value: 'SALE'},
];
const dataType = [
......@@ -45,13 +45,18 @@ const {width} = Dimensions.get('window');
const CaculatedStopLoss = (props) => {
const [product, setProduct] = useState();
const [type, setType] = useState('BUY');
const [lot, setLot] = useState('BUY');
const [priceOpen, setPriceOpen] = useState(525);
const [lot, setLot] = useState(0);
const [priceOpen, setPriceOpen] = useState(0);
const [fee, setFee] = useState(0);
const [surplus, setSurplus] = 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 (
<View style={{flex: 1}}>
......@@ -71,7 +76,6 @@ const CaculatedStopLoss = (props) => {
setProduct(items);
}}
/>
<AppText style={styles.txtTitle} i18nKey={'Tradding'} />
<RadioForm
formHorizontal={true}
......@@ -80,19 +84,47 @@ const CaculatedStopLoss = (props) => {
style={styles.row}
initial={0}
onPress={(value) => {
console.log({value: value});
setType(value);
}}
/>
<TextField title={I18n.t('CountLotTradding')} />
<TextField title={I18n.t('PriceOpen')} />
<TextField title={I18n.t('FeeTradding')} />
<TextField title={I18n.t('SurpusInit')} />
<TextField title={I18n.t('withdrawalsSession')} />
<TextField title={I18n.t('PriceClose')} />
<TextField title={I18n.t('PriceStopLoss')} />
<TextField
onChangeText={(val) => setLot(val)}
isNumber={true}
title={I18n.t('CountLotTradding')}
/>
<TextField
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'} />
<View style={styles.footer}>
<TouchableOpacity style={styles.btnContainer}>
<TouchableOpacity onPress={onClick} style={styles.btnContainer}>
<AppText style={styles.txtBtn} i18nKey={'Caculate'} />
</TouchableOpacity>
</View>
......
......@@ -27,7 +27,15 @@ const dataType = [
];
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 (
<View style={{flex: 1}}>
<HeaderBack title={'ConvertUnit'} />
......@@ -39,10 +47,14 @@ const ConvertUnit = (props) => {
width={WIDTHXD(431)}
data={dataType}
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>
<Text style={styles.txtNote}>1KG = 2 Pount</Text>
</View>
......@@ -53,16 +65,20 @@ const ConvertUnit = (props) => {
width={WIDTHXD(431)}
data={dataType}
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>
<Text style={styles.txtNote}>1 Pount = 0.5 KG</Text>
</View>
<View style={styles.footer}>
<TouchableOpacity style={styles.btnContainer}>
<TouchableOpacity onPress={onClick} style={styles.btnContainer}>
<AppText style={styles.txtBtn} i18nKey={'Caculate'} />
</TouchableOpacity>
</View>
......@@ -75,7 +91,7 @@ const styles = StyleSheet.create({
txtTitle: {
fontSize: getFontXD(42),
color: R.colors.color777,
marginTop: 15,
marginBottom: 15,
},
note: {
fontSize: getFontXD(36),
......
......@@ -257,4 +257,5 @@ export default {
ConvertUSD: 'Quy đổi USD/Tấn',
Saturday: 'Thứ 7',
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