Commit 6951cc5b authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

Merge branch 'master' of ssh://repo.cs.co.id:2222/wahyu/bahanoprek

# Conflicts:
#	view/Home.js
parents 8a088e2b 85da87be
...@@ -39,7 +39,7 @@ class Account extends React.Component { ...@@ -39,7 +39,7 @@ class Account extends React.Component {
premium: "", premium: "",
my_lat: 0, my_lat: 0,
my_long: 0, my_long: 0,
full_name:'' full_name: ''
} }
} }
...@@ -142,7 +142,7 @@ class Account extends React.Component { ...@@ -142,7 +142,7 @@ class Account extends React.Component {
img_card: img_card, img_card: img_card,
expire_date: expire, expire_date: expire,
premium: premium, premium: premium,
full_name:full_name full_name: full_name
}) })
}).catch(error => { }).catch(error => {
...@@ -183,30 +183,30 @@ class Account extends React.Component { ...@@ -183,30 +183,30 @@ class Account extends React.Component {
source={require('../assets/images/people-actv.png')} source={require('../assets/images/people-actv.png')}
/> />
</View> </View>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center',top:5 }}> <Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center', top: 5 }}>
{this.state.full_name} {this.state.full_name}
</Text> </Text>
<View style={{ height: 90, flexDirection: 'row', justifyContent: 'center' }}> <View style={{ height: 90, flexDirection: 'row', justifyContent: 'center' }}>
<TouchableOpacity style={{flexDirection:'row'}} onPress={() => this.props.navigation.navigate('Profile')}> <TouchableOpacity style={{ flexDirection: 'row' }} onPress={() => this.props.navigation.navigate('Profile')}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 17, textAlign: 'center',top:10 }}> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 17, textAlign: 'center', top: 10 }}>
{this.state.email} {this.state.email}
</Text> </Text>
<Icon <Icon
containerStyle={{margin:5}} containerStyle={{ margin: 5 }}
name='ios-create' name='ios-create'
type='ionicon' type='ionicon'
color='#CFB368' color='#CFB368'
/> />
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
{ {
this.props.set_card === false ? ( this.props.set_card === false ? (
<View> <View>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center', top:50 }}> <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center', top: 50 }}>
<View style={{ height: 250, flex: 1, backgroundColor: 'grey', marginRight: 20, marginLeft: 20, top: 25, borderRadius: 20 }}> <View style={{ height: 250, flex: 1, backgroundColor: 'grey', marginRight: 20, marginLeft: 20, top: 25, borderRadius: 20 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', top: 20 }}>No card yet</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', top: 20 }}>No card yet</Text>
<TouchableOpacity onPress={() => this.handleLoggin()}> <TouchableOpacity onPress={() => this.handleLoggin()}>
...@@ -221,36 +221,61 @@ class Account extends React.Component { ...@@ -221,36 +221,61 @@ class Account extends React.Component {
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>LOGOUT</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>LOGOUT</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
) : ( ) : (
<View> <View>
<View style={styles.Card}> <View style={styles.Card}>
<Card style={{ padding: 10, margin: 20, alignContent: 'center' }}> <View style={styles.card}>
<Text style={{fontSize:12, fontFamily: 'Gotham-Black', }}> <Card style={{ padding: 20, alignContent: 'center' }}>
YOUR CARD NUMBER | <Text style={{fontFamily:'Gotham-Light'}}>EXPIRED ON </Text> <Text style={{fontFamily:'Gotham-Light'}}>{this.state.expire_date}</Text> {'\n'}
</Text> <View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}>
<Text style={{ fontFamily: 'Gotham-Black', textAlign: "center", fontSize: 40, color: '#c9af6d' }}> <View style={{ flex: 0.5 }}>
{this.state.account_number} <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>YOUR CARD NUMBER</Text>
</Text> </View>
<View style={styles.line}></View> <View style={{ flex: 0.5 }}>
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left',fontSize:15 }}> {'\n'} <Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>Expired At {this.state.expire_date}</Text>
BALANCE : {this.state.balance}{'\n'} </View>
</Text> </View>
<View style={styles.line}></View> <View style={{ paddingHorizontal: 10 }}>
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left',fontSize:15 }}> {'\n'} <Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>
POINTS : {this.state.points}{'\n'} {this.state.account_number}
</Text> </Text>
</Card> </View>
<View style={styles.line}></View>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.2, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>BALANCE</Text>
</View>
<View style={{ flex: 0.8, alignItems: 'center' }}>
<Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text>
</View>
</View>
<View style={styles.line2}></View>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.2, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>POINTS</Text>
</View>
<View style={{ flex: 0.8, alignItems: 'center' }}>
<Text style={{ fontSize: 20, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.points}</Text>
</View>
</View>
</Card>
</View>
</View> </View>
<TouchableOpacity style={styles.submitTopUp} activeOpacity={.5} onPress={() => this.props.navigation.navigate('TopUpInfo')}> <TouchableOpacity style={styles.submitTopUp} activeOpacity={.5} onPress={() => this.props.navigation.navigate('TopUpInfo')}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#fff', textAlign: 'center' }}>TOP UP BALANCE</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#fff', textAlign: 'center' }}>TOP UP BALANCE</Text>
</TouchableOpacity> </TouchableOpacity>
<View style={{ padding: 10, margin: 10, height: 200, top: 15 }}> <View style={{ padding: 10, margin: 10, height: 200, top: 20 }}>
<ImageBackground style={{ width: '100%', height: '100%', padding: 0, margin: 0 }} resizeMode='stretch' source={this.state.img_card ? { uri: this.state.img_card } : null}> <ImageBackground style={{ width: '100%', height: '100%', padding: 0, margin: 0 }} resizeMode='stretch' source={this.state.img_card ? { uri: this.state.img_card } : null}>
<View style={{justifyContent:'center'}}> <View style={{ justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', margin:15,fontSize: 20, color: '#c9af6d',top:120 }}> <Text style={{ fontFamily: 'Gotham-Black', margin: 15, fontSize: 20, color: '#c9af6d', top: 120 }}>
{this.state.account_number} {this.state.account_number}
</Text> </Text>
</View> </View>
</ImageBackground> </ImageBackground>
</View> </View>
...@@ -260,7 +285,7 @@ class Account extends React.Component { ...@@ -260,7 +285,7 @@ class Account extends React.Component {
<View style={{ height: 50, alignItems: 'center' }}> <View style={{ height: 50, alignItems: 'center' }}>
<MaterialIcons name="monetization-on" size={30} color="gray" style={{ top: 20 }} /> <MaterialIcons name="monetization-on" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 30, fontSize: 14 }}>TRANSFER BALANCE</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 30, fontSize: 14 }}>TRANSFER BALANCE</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
...@@ -279,7 +304,7 @@ class Account extends React.Component { ...@@ -279,7 +304,7 @@ class Account extends React.Component {
<Card style={{ height: 100, width: 160 }}> <Card style={{ height: 100, width: 160 }}>
<View style={{ height: 50, alignItems: 'center' }}> <View style={{ height: 50, alignItems: 'center' }}>
<MaterialIcons name="autorenew" size={30} color="gray" style={{ top: 20 }} /> <MaterialIcons name="autorenew" size={30} color="gray" style={{ top: 20 }} />
<Text style={{fontFamily: 'Gotham-Black', textAlign: 'center', top: 30, fontSize: 14 }}>RENEWAL</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 30, fontSize: 14 }}>RENEWAL</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
...@@ -287,7 +312,7 @@ class Account extends React.Component { ...@@ -287,7 +312,7 @@ class Account extends React.Component {
<Card style={{ height: 100, width: 160 }}> <Card style={{ height: 100, width: 160 }}>
<View style={{ height: 50, alignItems: 'center' }}> <View style={{ height: 50, alignItems: 'center' }}>
<MaterialIcons name="autorenew" size={30} color="gray" style={{ top: 20 }} /> <MaterialIcons name="autorenew" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 30, fontSize: 14 }}>TRANSACTION HISTORY</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 30, fontSize: 14 }}>TRANSACTION HISTORY</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
...@@ -298,7 +323,7 @@ class Account extends React.Component { ...@@ -298,7 +323,7 @@ class Account extends React.Component {
<Card style={{ height: 100, width: 160 }}> <Card style={{ height: 100, width: 160 }}>
<View style={{ height: 50, alignItems: 'center' }}> <View style={{ height: 50, alignItems: 'center' }}>
<MaterialIcons name="autorenew" size={30} color="gray" style={{ top: 20 }} /> <MaterialIcons name="autorenew" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 30, fontSize: 14 }}>UPGRADE PREMIUM</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 30, fontSize: 14 }}>UPGRADE PREMIUM</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
...@@ -306,7 +331,7 @@ class Account extends React.Component { ...@@ -306,7 +331,7 @@ class Account extends React.Component {
null null
)} )}
</View> </View>
<View style={{ flex: 1}}> <View style={{ flex: 1 }}>
<TouchableOpacity onPress={() => this.logout()}> <TouchableOpacity onPress={() => this.logout()}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368', margin: 20 }}> <View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368', margin: 20 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>LOGOUT</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>LOGOUT</Text>
...@@ -343,32 +368,36 @@ const styles = StyleSheet.create({ ...@@ -343,32 +368,36 @@ const styles = StyleSheet.create({
}, },
Card: { Card: {
top: 60, top: 50,
alignItems: 'center', alignItems: 'center',
backgroundColor: 'white',
alignContent: 'center', alignContent: 'center',
}, },
card: {
top: 20,
flex: 1,
alignItems: 'center'
},
line: { line: {
top:3, top: 3,
borderRadius:1, borderRadius: 1,
borderColor:'black', borderColor: 'black',
borderWidth:1, borderWidth: 1,
width: "100%", width: "100%",
height: 1, height: 1,
bottom: 5, bottom: 5,
}, },
line1: { line1: {
top:3, top: 3,
borderRadius:1, borderRadius: 1,
borderColor:'black', borderColor: 'black',
borderWidth:1, borderWidth: 1,
width: "100%", width: "100%",
height: 1, height: 1,
bottom: 5, bottom: 5,
}, },
imgBackground: { imgBackground: {
...@@ -377,8 +406,8 @@ const styles = StyleSheet.create({ ...@@ -377,8 +406,8 @@ const styles = StyleSheet.create({
flex: 1 flex: 1
}, },
submitTopUp: { submitTopUp: {
marginTop: 35, marginTop: 70,
top: 25, top: 20,
paddingTop: 15, paddingTop: 15,
paddingBottom: 15, paddingBottom: 15,
marginLeft: 15, marginLeft: 15,
...@@ -401,7 +430,24 @@ const styles = StyleSheet.create({ ...@@ -401,7 +430,24 @@ const styles = StyleSheet.create({
flex: 2, flex: 2,
flexDirection: 'column-reverse', flexDirection: 'column-reverse',
alignContent: 'flex-start', alignContent: 'flex-start',
} },
line: {
borderBottomColor: '#c9af6d',
borderBottomWidth: 2,
alignSelf: 'stretch',
width: "100%",
height: 10,
bottom: 5,
},
line2: {
borderBottomColor: '#c9af6d',
borderBottomWidth: 1,
alignSelf: 'stretch',
width: "100%",
height: 10,
bottom: 5,
},
}) })
//subscribe //subscribe
......
...@@ -242,7 +242,7 @@ class Auth extends React.Component { ...@@ -242,7 +242,7 @@ class Auth extends React.Component {
headerTitleStyle: { headerTitleStyle: {
alignSelf: 'center', alignSelf: 'center',
fontFamily: 'Gotham-Black', fontFamily: 'Gotham-Black',
fontSize:18, fontSize: 18,
color: 'white', color: 'white',
textAlign: 'center' textAlign: 'center'
}, title: 'LANGUAGE' }, title: 'LANGUAGE'
...@@ -264,7 +264,18 @@ class Auth extends React.Component { ...@@ -264,7 +264,18 @@ class Auth extends React.Component {
<Stack.Screen name="Renewal" component={Renewal} /> <Stack.Screen name="Renewal" component={Renewal} />
<Stack.Screen name="Account" component={Account} /> <Stack.Screen name="Account" component={Account} />
<Stack.Screen name="Login" component={Login} options={{ headerShown: false }} /> <Stack.Screen name="Login" component={Login} options={{ headerShown: false }} />
<Stack.Screen name="Transfer Balance" component={TransferBalance} /> <Stack.Screen name="Transfer Balance" component={TransferBalance} options={{
headerStyle: { backgroundColor: "#CFB368" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 18,
},
title: 'TRANSFER BALANCE'
}} />
<Stack.Screen name="Register" component={Register} /> <Stack.Screen name="Register" component={Register} />
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> <Stack.Screen name="Email Confirmation" component={EmailConfirmation} />
<Stack.Screen name="Upgrade Premium" component={UpgradePremium} /> <Stack.Screen name="Upgrade Premium" component={UpgradePremium} />
...@@ -392,7 +403,7 @@ class Auth extends React.Component { ...@@ -392,7 +403,7 @@ class Auth extends React.Component {
<Stack.Screen name="Transaction Detail" component={TransactionDetail} /> <Stack.Screen name="Transaction Detail" component={TransactionDetail} />
{/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */} {/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */}
<Stack.Screen name="News Detail" component={NewsDetail} options={{ headerShown: false }}/> <Stack.Screen name="News Detail" component={NewsDetail} options={{ headerShown: false }} />
<Stack.Screen name="Confirm Your Order" component={MenuConfirmation} /> <Stack.Screen name="Confirm Your Order" component={MenuConfirmation} />
<Stack.Screen name="Date Time" component={DateTime} /> <Stack.Screen name="Date Time" component={DateTime} />
<Stack.Screen name="New Register" component={NewRegister} <Stack.Screen name="New Register" component={NewRegister}
......
...@@ -222,7 +222,6 @@ class Home extends React.Component { ...@@ -222,7 +222,6 @@ class Home extends React.Component {
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
<View>
<SliderBox <SliderBox
images={this.state.images} images={this.state.images}
onCurrentImagePressed={index => console.log(`image ${index} pressed`)} onCurrentImagePressed={index => console.log(`image ${index} pressed`)}
...@@ -257,8 +256,6 @@ class Home extends React.Component { ...@@ -257,8 +256,6 @@ class Home extends React.Component {
imageLoadingColor='#c7c7c7' imageLoadingColor='#c7c7c7'
onCurrentImagePressed={(index) => this.props.navigation.navigate('News Detail', {slug: this.state.slugs[index]})} onCurrentImagePressed={(index) => this.props.navigation.navigate('News Detail', {slug: this.state.slugs[index]})}
/> />
</View>
</View> </View>
<View style={styles.content}> <View style={styles.content}>
<View style={styles.card}> <View style={styles.card}>
......
...@@ -10,6 +10,7 @@ import session from '../function/session'; ...@@ -10,6 +10,7 @@ import session from '../function/session';
import * as Location from 'expo-location'; import * as Location from 'expo-location';
import * as Permissions from 'expo-permissions'; import * as Permissions from 'expo-permissions';
import * as Device from 'expo-device'; import * as Device from 'expo-device';
import NumberFormat from 'react-number-format';
class MenuSelection extends React.Component { class MenuSelection extends React.Component {
constructor(props) { constructor(props) {
...@@ -307,24 +308,23 @@ class MenuSelection extends React.Component { ...@@ -307,24 +308,23 @@ class MenuSelection extends React.Component {
)} )}
</View> </View>
<View> <View>
</View> </View>
<View style={styles.shadow}> <View style={styles.shadow}>
<View style={{ flex: 1, flexDirection: 'row' }}> <View style={{ flex: 1, flexDirection: 'row' }}>
<View style={{ flex: 0.7}}> <View style={{ flex: 1}}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black',top:10 }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : ( <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', textAlign: 'center',top:10,marginLeft:45 }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : (
<Text style={{ fontSize: 12 }}> Ongkir {this.props.grabamount} </Text> <Text style={{ fontSize: 12 }}> Ongkir {this.props.grabamount} </Text>
)} </Text> )} </Text>
<Text style={{ fontSize: 20, fontFamily: 'Gotham-Light', top:20 }}> Rp. {this.props.order_total}</Text> <NumberFormat decimalScale={0} value={this.props.order_total} renderText={value => <Text style={{ fontSize: 20, fontFamily: 'Gotham-Light', top: 20, textAlign: 'center' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View> </View>
<View style={{ flex: 1, height: 100 }}> <View style={{ flex: 1, height: 100 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Shopping Cart')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Shopping Cart')}>
<View> <View>
<View style={{ height: 50, borderRadius: 10, backgroundColor: '#CFB368',marginRight:20,marginLeft:20,top:10,flexDirection:'row',marginBottom:30}}> <View style={{ height: 40, borderRadius: 10, width: '65%', backgroundColor: '#CFB368', marginRight: 20, marginLeft: 40, top: 15, flexDirection: 'row', marginBottom: 30 }}>
<Image source={(require('../assets/icon/icon-order.png'))} style={{height:50,width:40,tintColor:'white',}}></Image> <Image source={(require('../assets/icon/icon-order.png'))} style={{ height: 40, width: 40, tintColor: 'white', }}></Image>
<Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 15,alignSelf:'center', textAlign: 'center' }}>View Cart</Text> <Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 15, alignSelf: 'center', textAlign: 'center' }}>View Cart</Text>
</View> </View>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -336,21 +336,20 @@ class MenuSelection extends React.Component { ...@@ -336,21 +336,20 @@ class MenuSelection extends React.Component {
) )
} }
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
backgroundColor: 'white', backgroundColor: 'white',
}, },
shadow: { shadow: {
borderRadius: 2, borderWidth:1,
borderColor: '#ddd', borderColor: '#ddd',
borderBottomWidth: 0, borderBottomWidth: 0,
shadowColor: '#000', shadowColor: '#000',
shadowOffset: { width: 0, height: 2 }, shadowOffset: { width: 0, height: 0 },
shadowOpacity: 10, shadowOpacity: 10,
shadowRadius: 5, shadowRadius: 0,
elevation: 0.5, elevation: 0,
marginTop: 10, marginTop: 10,
flex: 0.5, flex: 0.5,
height: 50, height: 50,
...@@ -422,4 +421,6 @@ export default connect(mapStateToProps, mapDispatchToProps)(MenuSelection) ...@@ -422,4 +421,6 @@ export default connect(mapStateToProps, mapDispatchToProps)(MenuSelection)
// </View> // </View>
// ) // )
// } // }
\ No newline at end of file
...@@ -4,7 +4,7 @@ import { Image } from 'react-native-elements'; ...@@ -4,7 +4,7 @@ import { Image } from 'react-native-elements';
import Axios from 'axios'; import Axios from 'axios';
import { TouchableOpacity, ScrollView } from 'react-native-gesture-handler'; import { TouchableOpacity, ScrollView } from 'react-native-gesture-handler';
import HTML from 'react-native-render-html'; import HTML from 'react-native-render-html';
import { getStatusBarHeight } from 'react-native-status-bar-height';
export default class NewsDetail extends React.Component { export default class NewsDetail extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -13,14 +13,17 @@ export default class NewsDetail extends React.Component { ...@@ -13,14 +13,17 @@ export default class NewsDetail extends React.Component {
subtitle: '', subtitle: '',
image: '', image: '',
content: '', content: '',
image_height: 400 image_height: 400,
statusbar_height: 50
} }
} }
componentDidMount() { componentDidMount() {
const screenWidth = Math.round(Dimensions.get('window').width); const screenWidth = Math.round(Dimensions.get('window').width);
const statusBarHeight = getStatusBarHeight();
this.setState({ this.setState({
image_height: screenWidth image_height: screenWidth,
statusbar_height: statusBarHeight
}) })
this.get_news_detail(this.props.route.params.slug) this.get_news_detail(this.props.route.params.slug)
} }
...@@ -42,7 +45,7 @@ export default class NewsDetail extends React.Component { ...@@ -42,7 +45,7 @@ export default class NewsDetail extends React.Component {
render() { render() {
console.log('Image : ' + this.state.image) console.log('Image : ' + this.state.image)
return ( return (
<View style={styles.container}> <View style={styles.container(this.state.statusbar_height)}>
<View style={styles.header}> <View style={styles.header}>
<TouchableOpacity onPress={() => this.props.navigation.goBack()}> <TouchableOpacity onPress={() => this.props.navigation.goBack()}>
<Image source={require('../assets/icon/back.png')} style={{width: 35, height: 35}} /> <Image source={require('../assets/icon/back.png')} style={{width: 35, height: 35}} />
...@@ -66,11 +69,11 @@ export default class NewsDetail extends React.Component { ...@@ -66,11 +69,11 @@ export default class NewsDetail extends React.Component {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: (marginTop) => ({
flex: 1, flex: 1,
marginTop: 29, marginTop: marginTop,
backgroundColor: 'white', backgroundColor: 'white',
}, }),
header: { header: {
height: 60, height: 60,
paddingHorizontal: 5, paddingHorizontal: 5,
......
import React from 'react'; import React from 'react';
import { View, Text, TextInput, StyleSheet, Button, Alert } from 'react-native'; import { View, Text, TextInput, StyleSheet, Button, Alert ,ScrollView,TouchableOpacity,Image } from 'react-native';
import Axios from 'axios'; import Axios from 'axios';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
...@@ -79,60 +79,47 @@ class TransferBalance extends React.Component { ...@@ -79,60 +79,47 @@ class TransferBalance extends React.Component {
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <ScrollView>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>Transfer Balance</Text> <View style={{ flex: 3 }}>
</View> <View style={{ flex: 1, margin: 20,top:20 }}>
<View style={styles.content}> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Phone</Text>
<View style={styles.name_addrees_input}> <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
<View style={styles.field_name_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Phone</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(destination) => this.setState({ destination })} onChangeText={(destination) => this.setState({ destination })}
value={this.state.destination} value={this.state.destination}
keyboardType='number-pad' /> keyboardType='number-pad' />
</View> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Amount</Text>
</View> <TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
<View style={styles.field_detail_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Amount</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(amount) => this.setState({ amount })} onChangeText={(amount) => this.setState({ amount })}
value={this.state.amount} value={this.state.amount}
keyboardType='number-pad'/> keyboardType='number-pad'/>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Current Balance</Text>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(no_tlp) => this.setState({ no_tlp })}
editable={false}>
{this.state.balance}
</TextInput>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Message</Text>
<TextInput style={{ height: 100, borderWidth: 1, padding: 5, margin: 10, borderRadius: 10, borderColor: 'grey', fontFamily: 'Gotham-Black', textAlign: 'center', color: 'grey', fontWeight: 'bold', fontSize: 20 }}
onChangeText={(reference) => this.setState({ reference })}
value={this.state.reference}>
</TextInput>
</View>
</View>
<View style={{ flex: 2 }}>
<View style={{ flex: 1 }}>
<View style={{ flex: 1, flexDirection: 'row', top: 10, margin: 5,marginBottom:20,marginLeft:20,marginRight:20}}>
<View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity title="Edit" onPress={() => this.handleSend()}>
<View style={{ height: 40, borderRadius: 20, backgroundColor: '#CFB368',marginRight:40,marginLeft:40,justifyContent:'center'}}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 19, textAlign: 'center', margin: 20 }}>Save</Text>
</View> </View>
</View> </TouchableOpacity>
<View style={styles.curent_balance}>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontSize: 20 }} >Current Balance </Text>
</View>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontSize: 20 }}>{this.state.balance}</Text>
</View>
</View>
<View style={styles.field_detail_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Reference</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 100, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(reference) => this.setState({ reference })}
value={this.state.reference} />
</View>
</View>
{/* <View style={{ justifyContent: 'center', margin: 5 }}>
<Button title="Activate" onPress={() => this.handle()}></Button>
</View> */}
<View style={{ justifyContent: 'center' }} >
<Button title="SEND" onPress={() => this.handleSend()}></Button>
</View> </View>
</View> </View>
</View> </View>
</View> </View>
</ScrollView>
</View>
) )
} }
} }
...@@ -207,4 +194,52 @@ const mapDispatchToProps = (dispacth) => { ...@@ -207,4 +194,52 @@ const mapDispatchToProps = (dispacth) => {
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(TransferBalance); export default connect(mapStateToProps, mapDispatchToProps)(TransferBalance);
\ No newline at end of file
{/* <View style={styles.content}>
<View style={styles.name_addrees_input}>
<View style={styles.field_name_addrees}>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(destination) => this.setState({ destination })}
value={this.state.destination}
keyboardType='number-pad' />
</View>
</View>
<View style={styles.field_detail_addrees}>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(amount) => this.setState({ amount })}
value={this.state.amount}
keyboardType='number-pad'/>
</View>
</View>
<View style={styles.curent_balance}>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontSize: 20 }} >Current Balance </Text>
</View>
<View style={{ flex: 1, margin: 10 }}>
<Text style={{ fontSize: 20 }}>{this.state.balance}</Text>
</View>
</View>
<View style={styles.field_detail_addrees}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Reference</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 100, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(reference) => this.setState({ reference })}
value={this.state.reference} />
</View>
</View>
{/* <View style={{ justifyContent: 'center', margin: 5 }}>
<Button title="Activate" onPress={() => this.handle()}></Button>
</View> */}
// <View style={{ justifyContent: 'center' }} >
// <Button title="SEND" onPress={() => this.handleSend()}></Button>
// </View>
// </View>
// </View> */}
\ No newline at end of file
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