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 {
premium: "",
my_lat: 0,
my_long: 0,
full_name:''
full_name: ''
}
}
......@@ -142,7 +142,7 @@ class Account extends React.Component {
img_card: img_card,
expire_date: expire,
premium: premium,
full_name:full_name
full_name: full_name
})
}).catch(error => {
......@@ -183,18 +183,18 @@ class Account extends React.Component {
source={require('../assets/images/people-actv.png')}
/>
</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}
</Text>
<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}
</Text>
<Icon
containerStyle={{margin:5}}
containerStyle={{ margin: 5 }}
name='ios-create'
type='ionicon'
color='#CFB368'
......@@ -206,7 +206,7 @@ class Account extends React.Component {
{
this.props.set_card === false ? (
<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 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', top: 20 }}>No card yet</Text>
<TouchableOpacity onPress={() => this.handleLoggin()}>
......@@ -225,30 +225,55 @@ class Account extends React.Component {
) : (
<View>
<View style={styles.Card}>
<Card style={{ padding: 10, margin: 20, alignContent: 'center' }}>
<Text style={{fontSize:12, fontFamily: 'Gotham-Black', }}>
YOUR CARD NUMBER | <Text style={{fontFamily:'Gotham-Light'}}>EXPIRED ON </Text> <Text style={{fontFamily:'Gotham-Light'}}>{this.state.expire_date}</Text> {'\n'}
</Text>
<Text style={{ fontFamily: 'Gotham-Black', textAlign: "center", fontSize: 40, color: '#c9af6d' }}>
<View style={styles.card}>
<Card style={{ padding: 20, alignContent: 'center' }}>
<View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}>
<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>YOUR CARD NUMBER</Text>
</View>
<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>Expired At {this.state.expire_date}</Text>
</View>
</View>
<View style={{ paddingHorizontal: 10 }}>
<Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>
{this.state.account_number}
</Text>
</View>
<View style={styles.line}></View>
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left',fontSize:15 }}> {'\n'}
BALANCE : {this.state.balance}{'\n'}
</Text>
<View style={styles.line}></View>
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left',fontSize:15 }}> {'\n'}
POINTS : {this.state.points}{'\n'}
</Text>
<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>
<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>
</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}>
<View style={{justifyContent:'center'}}>
<Text style={{ fontFamily: 'Gotham-Black', margin:15,fontSize: 20, color: '#c9af6d',top:120 }}>
<View style={{ justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', margin: 15, fontSize: 20, color: '#c9af6d', top: 120 }}>
{this.state.account_number}
</Text>
</View>
......@@ -279,7 +304,7 @@ class Account extends React.Component {
<Card style={{ height: 100, width: 160 }}>
<View style={{ height: 50, alignItems: 'center' }}>
<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>
</Card>
</TouchableOpacity>
......@@ -306,7 +331,7 @@ class Account extends React.Component {
null
)}
</View>
<View style={{ flex: 1}}>
<View style={{ flex: 1 }}>
<TouchableOpacity onPress={() => this.logout()}>
<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>
......@@ -343,28 +368,32 @@ const styles = StyleSheet.create({
},
Card: {
top: 60,
top: 50,
alignItems: 'center',
backgroundColor: 'white',
alignContent: 'center',
},
card: {
top: 20,
flex: 1,
alignItems: 'center'
},
line: {
top:3,
borderRadius:1,
borderColor:'black',
borderWidth:1,
top: 3,
borderRadius: 1,
borderColor: 'black',
borderWidth: 1,
width: "100%",
height: 1,
bottom: 5,
},
line1: {
top:3,
borderRadius:1,
borderColor:'black',
borderWidth:1,
top: 3,
borderRadius: 1,
borderColor: 'black',
borderWidth: 1,
width: "100%",
height: 1,
bottom: 5,
......@@ -377,8 +406,8 @@ const styles = StyleSheet.create({
flex: 1
},
submitTopUp: {
marginTop: 35,
top: 25,
marginTop: 70,
top: 20,
paddingTop: 15,
paddingBottom: 15,
marginLeft: 15,
......@@ -401,7 +430,24 @@ const styles = StyleSheet.create({
flex: 2,
flexDirection: 'column-reverse',
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
......
......@@ -242,7 +242,7 @@ class Auth extends React.Component {
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
fontSize:18,
fontSize: 18,
color: 'white',
textAlign: 'center'
}, title: 'LANGUAGE'
......@@ -264,7 +264,18 @@ class Auth extends React.Component {
<Stack.Screen name="Renewal" component={Renewal} />
<Stack.Screen name="Account" component={Account} />
<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="Email Confirmation" component={EmailConfirmation} />
<Stack.Screen name="Upgrade Premium" component={UpgradePremium} />
......@@ -392,7 +403,7 @@ class Auth extends React.Component {
<Stack.Screen name="Transaction Detail" component={TransactionDetail} />
{/* <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="Date Time" component={DateTime} />
<Stack.Screen name="New Register" component={NewRegister}
......
......@@ -222,7 +222,6 @@ class Home extends React.Component {
</TouchableOpacity>
</View>
</View>
<View>
<SliderBox
images={this.state.images}
onCurrentImagePressed={index => console.log(`image ${index} pressed`)}
......@@ -258,8 +257,6 @@ class Home extends React.Component {
onCurrentImagePressed={(index) => this.props.navigation.navigate('News Detail', {slug: this.state.slugs[index]})}
/>
</View>
</View>
<View style={styles.content}>
<View style={styles.card}>
<Card>
......
......@@ -10,6 +10,7 @@ import session from '../function/session';
import * as Location from 'expo-location';
import * as Permissions from 'expo-permissions';
import * as Device from 'expo-device';
import NumberFormat from 'react-number-format';
class MenuSelection extends React.Component {
constructor(props) {
......@@ -307,23 +308,22 @@ class MenuSelection extends React.Component {
)}
</View>
<View>
</View>
<View style={styles.shadow}>
<View style={{ flex: 1, flexDirection: 'row' }}>
<View style={{ flex: 0.7}}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black',top:10 }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : (
<View style={{ flex: 1}}>
<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>
<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 style={{ flex: 1, height: 100 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Shopping Cart')}>
<View>
<View style={{ height: 50, borderRadius: 10, backgroundColor: '#CFB368',marginRight:20,marginLeft:20,top:10,flexDirection:'row',marginBottom:30}}>
<Image source={(require('../assets/icon/icon-order.png'))} style={{height:50,width:40,tintColor:'white',}}></Image>
<Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 15,alignSelf:'center', textAlign: 'center' }}>View Cart</Text>
<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: 40, width: 40, tintColor: 'white', }}></Image>
<Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 15, alignSelf: 'center', textAlign: 'center' }}>View Cart</Text>
</View>
</View>
</TouchableOpacity>
......@@ -336,21 +336,20 @@ class MenuSelection extends React.Component {
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white',
},
shadow: {
borderRadius: 2,
borderWidth:1,
borderColor: '#ddd',
borderBottomWidth: 0,
shadowColor: '#000',
shadowOffset: { width: 0, height: 2 },
shadowOffset: { width: 0, height: 0 },
shadowOpacity: 10,
shadowRadius: 5,
elevation: 0.5,
shadowRadius: 0,
elevation: 0,
marginTop: 10,
flex: 0.5,
height: 50,
......@@ -423,3 +422,5 @@ export default connect(mapStateToProps, mapDispatchToProps)(MenuSelection)
// )
// }
......@@ -4,7 +4,7 @@ import { Image } from 'react-native-elements';
import Axios from 'axios';
import { TouchableOpacity, ScrollView } from 'react-native-gesture-handler';
import HTML from 'react-native-render-html';
import { getStatusBarHeight } from 'react-native-status-bar-height';
export default class NewsDetail extends React.Component {
constructor(props) {
super(props);
......@@ -13,14 +13,17 @@ export default class NewsDetail extends React.Component {
subtitle: '',
image: '',
content: '',
image_height: 400
image_height: 400,
statusbar_height: 50
}
}
componentDidMount() {
const screenWidth = Math.round(Dimensions.get('window').width);
const statusBarHeight = getStatusBarHeight();
this.setState({
image_height: screenWidth
image_height: screenWidth,
statusbar_height: statusBarHeight
})
this.get_news_detail(this.props.route.params.slug)
}
......@@ -42,7 +45,7 @@ export default class NewsDetail extends React.Component {
render() {
console.log('Image : ' + this.state.image)
return (
<View style={styles.container}>
<View style={styles.container(this.state.statusbar_height)}>
<View style={styles.header}>
<TouchableOpacity onPress={() => this.props.navigation.goBack()}>
<Image source={require('../assets/icon/back.png')} style={{width: 35, height: 35}} />
......@@ -66,11 +69,11 @@ export default class NewsDetail extends React.Component {
const styles = StyleSheet.create({
container: {
container: (marginTop) => ({
flex: 1,
marginTop: 29,
marginTop: marginTop,
backgroundColor: 'white',
},
}),
header: {
height: 60,
paddingHorizontal: 5,
......
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 { connect } from 'react-redux';
import ActionType from '../redux/globalActionType';
......@@ -79,59 +79,46 @@ class TransferBalance extends React.Component {
render() {
return (
<View style={styles.container}>
<View style={styles.header}>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>Transfer Balance</Text>
</View>
<View style={styles.content}>
<View style={styles.name_addrees_input}>
<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 }}
<ScrollView>
<View style={{ flex: 3 }}>
<View style={{ flex: 1, margin: 20,top:20 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Phone</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={(destination) => this.setState({ destination })}
value={this.state.destination}
keyboardType='number-pad' />
</View>
</View>
<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 }}
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Amount</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={(amount) => this.setState({ amount })}
value={this.state.amount}
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={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: 2 }}>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 100, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(reference) => this.setState({ reference })}
value={this.state.reference} />
<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>
</TouchableOpacity>
</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>
</ScrollView>
</View>
)
}
......@@ -208,3 +195,51 @@ const mapDispatchToProps = (dispacth) => {
}
export default connect(mapStateToProps, mapDispatchToProps)(TransferBalance);
{/* <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