Commit 433a1919 authored by Trisno's avatar Trisno

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

# Conflicts:
#	view/Home.js
parents 5fadb173 f2c03d89
{ {
"expo": { "expo": {
"name": "Excelso_update v1. siang.13.05.2020", "name": "Excelso_update 09.00 / 14.05.2020",
"slug": "excelso-pro", "slug": "excelso-pro",
"privacy": "public", "privacy": "public",
"sdkVersion": "36.0.0", "sdkVersion": "36.0.0",
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
"organization": "ravintola", "organization": "ravintola",
"project": "ravintola", "project": "ravintola",
"authToken": "5a140e31fb884af58c7d9e20e8baa5ddc8fee9ac79ba427786da245b3015f6d3", "authToken": "5a140e31fb884af58c7d9e20e8baa5ddc8fee9ac79ba427786da245b3015f6d3",
"url": "your sentry url here" // OPTIONAL- only necessary when self-hosting Sentry "url": "your sentry url here"
} }
} }
] ]
......
import { Alert } from 'react-native'; import { Alert } from 'react-native';
export default function session(response,navigation) { export default function session(response,error_status, navigation) {
if (response.code === "WRONG_SESSION_ID") { if (response.code === "WRONG_SESSION_ID") {
Alert.alert( Alert.alert(
...@@ -9,9 +9,21 @@ export default function session(response,navigation) { ...@@ -9,9 +9,21 @@ export default function session(response,navigation) {
'Session Anda Sudah Habis Silahkan Logout Terlebih Dahulu ! ', 'Session Anda Sudah Habis Silahkan Logout Terlebih Dahulu ! ',
[ [
{ text: 'OK', onPress: () => navigation.replace('Login') } { text: 'OK', onPress: () => navigation.replace('Login') }
]
)
} else if (error_status == 500) {
Alert.alert(
'Server',
'Server Error ',
[
{ text: 'OK' }
] ]
) )
}else{
Alert.alert(response_data.msg);
} }
} }
\ No newline at end of file
...@@ -8,10 +8,12 @@ import { ...@@ -8,10 +8,12 @@ import {
ScrollView, ScrollView,
TouchableOpacity, TouchableOpacity,
Alert, Alert,
Button Button,
ImageBackground
} from 'react-native'; } from 'react-native';
import { StackActions } from '@react-navigation/native'; import { StackActions } from '@react-navigation/native';
import { Icon } from 'react-native-elements'
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { Card } from 'react-native-shadow-cards'; import { Card } from 'react-native-shadow-cards';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
...@@ -97,10 +99,11 @@ class Account extends React.Component { ...@@ -97,10 +99,11 @@ class Account extends React.Component {
lat: this.state.my_lat, lat: this.state.my_lat,
long: this.state.my_long, long: this.state.my_long,
closest_outlet: 1 closest_outlet: 1
} }
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile', params).then(res => {
// console.log('WAKWAWWWW ' + JSON.stringify(res.data)) console.log('WAKWAWWWW ' + JSON.stringify(res.data))
const dataCard = res.data const dataCard = res.data
let email = dataCard.email let email = dataCard.email
let point = dataCard.kaspro_point let point = dataCard.kaspro_point
...@@ -126,7 +129,7 @@ class Account extends React.Component { ...@@ -126,7 +129,7 @@ class Account extends React.Component {
this.props.setCardactive(cardProps) this.props.setCardactive(cardProps)
} }
let account_number = dataCard.kaspro_account_number let account_number = dataCard.card_number
this.setState({ this.setState({
email: email, email: email,
...@@ -141,9 +144,9 @@ class Account extends React.Component { ...@@ -141,9 +144,9 @@ class Account extends React.Component {
}) })
}).catch(error => { }).catch(error => {
const {navigation} = this.props const { navigation } = this.props
let response = error.response.data let response = error.response.data
session(response,navigation) session(response, navigation)
Alert.alert(response.msg); Alert.alert(response.msg);
console.log('ini error ' + error) console.log('ini error ' + error)
}) })
...@@ -171,18 +174,27 @@ class Account extends React.Component { ...@@ -171,18 +174,27 @@ class Account extends React.Component {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<ScrollView> <ScrollView>
<View style={styles.profil}> <View style={{ flex: 1, height: 90, top: 30 }}>
<Image <View style={{ alignSelf: 'center' }}>
style={{ height: 70, width: 70, top: 15, }} <Image
source={require('../assets/images/user.png')} style={{ height: 70, width: 70, top: 5, justifyContent: 'center' }}
/> source={require('../assets/images/people-actv.png')}
<Text style={styles.txtNama}> />
{this.props.username} </View>
</Text> <View style={{ height: 60, flexDirection: 'row', justifyContent: 'center' }}>
<Text style={styles.txtEmail}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')}>
{this.state.email} {this.props.set_card} <Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center', margin: 15 }}>
</Text> {this.state.email} {this.props.set_card}
</Text>
</TouchableOpacity>
<Icon
containerStyle={{ top: 8 }}
name='ios-create'
type='ionicon'
/>
</View>
</View> </View>
{ {
this.props.set_card === false ? ( this.props.set_card === false ? (
<View> <View>
...@@ -211,65 +223,61 @@ class Account extends React.Component { ...@@ -211,65 +223,61 @@ class Account extends React.Component {
</Text> </Text>
</Card> */} </Card> */}
</View> </View>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center' }}> <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center', top: 20 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')} style={{ marginBottom: 10 }}> <View style={{ height: 250, flex: 1, backgroundColor: 'grey', marginRight: 20, marginLeft: 20, top: 25, borderRadius: 20 }}>
<Card style={{ height: 100, width: 160 }}> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', top: 20 }}>No card yet</Text>
<View style={{ height: 50, alignItems: 'center' }}> <TouchableOpacity onPress={() => this.handleLoggin()}>
<MaterialIcons name="monetization-on" size={30} color="gray" style={{ top: 20 }} /> <View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, top: 90 }}>
<Text style={{ textAlign: 'center', top: 30, fontSize: 14 }}>PROFIL</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}>ACTIVATION CARD</Text>
</View>
</Card>
</TouchableOpacity>
<View style={{ width: 5 }}></View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation')}>
<Card style={{ height: 100, width: 160 }}>
<View style={{ height: 50, alignItems: 'center' }}>
<AntDesign name="shoppingcart" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ textAlign: 'center', top: 30, fontSize: 14 }}>ACTIVATION CARD</Text>
</View> </View>
</Card> </TouchableOpacity>
</TouchableOpacity> </View>
</View>
<View style={{ flex: 1, margin: 40 }}>
<Button
title="Logout"
onPress={() => this.logout()}
/>
</View> </View>
<TouchableOpacity onPress={() => this.logout()}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368', margin: 40, top: 30 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>LOGOUT</Text>
</View>
</TouchableOpacity>
</View> </View>
) : ( ) : (
<View> <View>
<View style={styles.Card}> <View style={styles.Card}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 10, margin: 20, alignContent: 'center' }}>
<Text> <Text style={{fontSize:12, fontFamily: 'Gotham-Black', }}>
YOUR CARD NUMBER | {this.state.expire_date}{'\n'} YOUR CARD NUMBER | EXPIRED ON {this.state.expire_date}{'\n'}
</Text> </Text>
<Text style={{ textAlign: "center", fontSize: 40, color: '#c9af6d' }}> <Text style={{ fontFamily: 'Gotham-Black', textAlign: "center", fontSize: 40, color: '#c9af6d' }}>
{this.state.account_number} {this.state.account_number}
</Text> </Text>
<View style={styles.line}></View> <View style={styles.line}></View>
<Text style={{ textAlign: 'left', fontWeight: 'bold' }}> {'\n'} <Text style={{fontFamily: 'Gotham-Light', textAlign: 'left', fontWeight: 'bold' }}> {'\n'}
BALANCE: {this.state.balance}{'\n'} BALANCE : {this.state.balance}{'\n'}
</Text> </Text>
<View style={styles.line}></View> <View style={styles.line}></View>
<Text style={{ textAlign: 'left', fontWeight: 'bold' }}>{'\n'} <Text style={{fontFamily: 'Gotham-Light', textAlign: 'left', fontWeight: 'bold' }}>{'\n'}
POINTS: {this.state.points} POINTS : {this.state.points}
</Text> </Text>
</Card> </Card>
</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={{ 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 }}> <View style={{ padding: 10, margin: 10, height: 200, top: 15 }}>
<Image 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'}}>
<Text style={{ fontFamily: 'Gotham-Black', margin:15,fontSize: 20, color: '#c9af6d',top:120 }}>
{this.state.account_number}
</Text>
</View>
</ImageBackground>
</View> </View>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center' }}> <View style={{ flex: 1, flexDirection: 'row', justifyContent: 'center', top: 10 }}>
<TouchableOpacity style={{ marginBottom: 10 }} onPress={() => this.TransferBalance()} > <TouchableOpacity style={{ marginBottom: 10 }} onPress={() => this.TransferBalance()} >
<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="monetization-on" size={30} color="gray" style={{ top: 20 }} /> <MaterialIcons name="monetization-on" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ 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>
...@@ -278,7 +286,7 @@ class Account extends React.Component { ...@@ -278,7 +286,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' }}>
<AntDesign name="shoppingcart" size={30} color="gray" style={{ top: 20 }} /> <AntDesign name="shoppingcart" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ textAlign: 'center', top: 30, fontSize: 14 }}>USE BALANCE</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 30, fontSize: 14 }}>USE BALANCE</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
...@@ -288,7 +296,7 @@ class Account extends React.Component { ...@@ -288,7 +296,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={{ 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>
...@@ -296,7 +304,7 @@ class Account extends React.Component { ...@@ -296,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={{ 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>
...@@ -307,32 +315,27 @@ class Account extends React.Component { ...@@ -307,32 +315,27 @@ 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={{ 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>
) : ( ) : (
null null
)} )}
<TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')} style={{ marginBottom: 10 }}>
<Card style={{ height: 100, width: 160 }}>
<View style={{ height: 50, alignItems: 'center' }}>
<MaterialIcons name="monetization-on" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ textAlign: 'center', top: 30, fontSize: 14 }}>PROFIL</Text>
</View>
</Card>
</TouchableOpacity>
</View> </View>
<View style={{ flex: 1, margin: 40 }}> <View style={{ flex: 1}}>
<Button <TouchableOpacity onPress={() => this.logout()}>
title="Logout" <View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368', margin: 20 }}>
onPress={() => this.logout()} <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>LOGOUT</Text>
/> </View>
</TouchableOpacity>
</View> </View>
</View> </View>
) )
} }
</ScrollView> </ScrollView>
</View> </View>
) )
} }
...@@ -353,22 +356,26 @@ const styles = StyleSheet.create({ ...@@ -353,22 +356,26 @@ const styles = StyleSheet.create({
height: 150, height: 150,
backgroundColor: 'white', backgroundColor: 'white',
alignItems: 'center', alignItems: 'center',
top: 20, top: 40,
}, },
Card: { Card: {
top: 50,
alignItems: 'center', alignItems: 'center',
backgroundColor: 'white', backgroundColor: 'white',
alignContent: 'center', alignContent: 'center',
}, },
line: { line: {
borderBottomColor: "black", top:3,
borderBottomWidth: StyleSheet.hairlineWidth, borderRadius:1,
borderColor:'#c9af6d',
borderWidth:1,
alignSelf: 'stretch', alignSelf: 'stretch',
width: "100%", width: "100%",
height: 3, height: 3,
bottom: 5, bottom: 5,
}, },
imgBackground: { imgBackground: {
...@@ -377,7 +384,8 @@ const styles = StyleSheet.create({ ...@@ -377,7 +384,8 @@ const styles = StyleSheet.create({
flex: 1 flex: 1
}, },
submitTopUp: { submitTopUp: {
marginTop: 10, marginTop: 35,
top: 25,
paddingTop: 15, paddingTop: 15,
paddingBottom: 15, paddingBottom: 15,
marginLeft: 15, marginLeft: 15,
...@@ -388,6 +396,19 @@ const styles = StyleSheet.create({ ...@@ -388,6 +396,19 @@ const styles = StyleSheet.create({
borderColor: '#fff', borderColor: '#fff',
textAlign: 'center', textAlign: 'center',
}, },
logo: {
alignSelf: 'flex-start',
marginTop: 50,
width: 290,
height: 290,
bottom: 145,
},
v_logo: {
flex: 2,
flexDirection: 'column-reverse',
alignContent: 'flex-start',
}
}) })
//subscribe //subscribe
...@@ -416,3 +437,23 @@ const mapDispatchToProps = (dispacth) => { ...@@ -416,3 +437,23 @@ const mapDispatchToProps = (dispacth) => {
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(Account); export default connect(mapStateToProps, mapDispatchToProps)(Account);
{/* <TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')} style={{ marginBottom: 10 }}>
<Card style={{ height: 100, width: 160 }}>
<View style={{ height: 50, alignItems: 'center' }}>
<MaterialIcons name="monetization-on" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ textAlign: 'center', top: 30, fontSize: 14 }}>PROFIL</Text>
</View>
</Card>
</TouchableOpacity>
<View style={{ width: 5 }}></View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation')}>
<Card style={{ height: 100, width: 160 }}>
<View style={{ height: 50, alignItems: 'center' }}>
<AntDesign name="shoppingcart" size={30} color="gray" style={{ top: 20 }} />
<Text style={{ textAlign: 'center', top: 30, fontSize: 14 }}>ACTIVATION CARD</Text>
</View>
</Card>
</TouchableOpacity> */}
\ No newline at end of file
...@@ -50,7 +50,8 @@ import RewardDetail from './RewardDetail'; ...@@ -50,7 +50,8 @@ import RewardDetail from './RewardDetail';
import RewardSelect from './RewardSelect'; import RewardSelect from './RewardSelect';
import Outlets from './Outlets'; import Outlets from './Outlets';
import RewardHistory from './RewardHistory'; import RewardHistory from './RewardHistory';
// import { Image } from 'native-base'; import WelcomeReg from './WelcomeReg';
import WelcomeLog from './WelcomeLog';
enableScreens(); enableScreens();
...@@ -142,18 +143,64 @@ class Auth extends React.Component { ...@@ -142,18 +143,64 @@ class Auth extends React.Component {
{ {
this.props.session_id === '' ? ( this.props.session_id === '' ? (
<> <>
{/* <Stack.Screen name="Change language" component={ChangeLanguage} /> */}
<Stack.Screen name="Login" component={Login} options={{ headerShown: false }} /> <Stack.Screen name="Login" component={Login} options={{ headerShown: false }} />
<Stack.Screen name="LoginWelcome" component={WelcomeLog} options={{
headerShown: false ,
}} />
<Stack.Screen name="Home" component={Home} /> <Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Profile" component={ProfilePage} />
<Stack.Screen name="Change Profil" component={ChangeProfile} />
<Stack.Screen name="Profile" component={ProfilePage} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'PROFIL'
}}/>
<Stack.Screen name="Change Profil" component={ChangeProfile} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'CHANGE PROFIL'
}}/>
<Stack.Screen name="Register" component={Register} /> <Stack.Screen name="Register" component={Register} />
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> {/* <Stack.Screen name="Change language" component={ChangeLanguage} /> */}
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'EMAIL CONFIRMATION'
}} />
<Stack.Screen name="Welcomes" component={WelcomeReg} options={{
headerShown: false ,
}} />
</> </>
) : this.props.pageEmailConfirmation === true ? ( ) : this.props.pageEmailConfirmation === true ? (
<> <>
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> <Stack.Screen name="Email Confirmation" component={EmailConfirmation} />
<Stack.Screen name="Login" component={Login} /> <Stack.Screen name="Login" component={Login} />
<Stack.Screen name="LoginWelcome" component={WelcomeLog} options={{
headerShown: false ,
}} />
<Stack.Screen name="Home" component={Home} options={{ headerShown: false }} /> <Stack.Screen name="Home" component={Home} options={{ headerShown: false }} />
</> </>
) : ( ) : (
...@@ -163,19 +210,42 @@ class Auth extends React.Component { ...@@ -163,19 +210,42 @@ class Auth extends React.Component {
headerShown: false, headerShown: false,
title: 'TODAY PROMOTION', title: 'TODAY PROMOTION',
headerStyle: { backgroundColor: '#CFB368' }, headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle:{alignContent:'center'}, headerTitleContainerStyle: { alignContent: 'center' },
headerTitleStyle: { headerTitleStyle: {
alignSelf: 'center', alignSelf: 'center',
fontFamily: 'Gotham-Black', fontFamily: 'Gotham-Black',
color:'white', color: 'white',
textAlign:'center' textAlign: 'center'
} }
}} /> }} />
<Stack.Screen name="Profile" component={ProfilePage} /> <Stack.Screen name="Profile" component={ProfilePage}
options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'PROFIL'
}}/>
<Stack.Screen name="Change Profil" component={ChangeProfile} /> <Stack.Screen name="Change Profil" component={ChangeProfile} />
<Stack.Screen name="Change language" component={ChangeLanguage} /> <Stack.Screen name="Change language" component={ChangeLanguage} />
<Stack.Screen name="Change password" component={ChangePassword} /> <Stack.Screen name="Change password" component={ChangePassword} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'CHANGE PROFIL'
}}/>
<Stack.Screen name="Card Activation" component={CardActivation} /> <Stack.Screen name="Card Activation" component={CardActivation} />
<Stack.Screen name="Renewal" component={Renewal} /> <Stack.Screen name="Renewal" component={Renewal} />
<Stack.Screen name="Account" component={Account} /> <Stack.Screen name="Account" component={Account} />
...@@ -188,13 +258,25 @@ class Auth extends React.Component { ...@@ -188,13 +258,25 @@ class Auth extends React.Component {
<Stack.Screen name="Delivery Address" component={DeliveryAddress} /> <Stack.Screen name="Delivery Address" component={DeliveryAddress} />
<Stack.Screen name="Address Detail" component={AddressDetail} /> <Stack.Screen name="Address Detail" component={AddressDetail} />
<Stack.Screen name="Menu Detail" component={MenuDetail} /> <Stack.Screen name="Menu Detail" component={MenuDetail} />
<Stack.Screen name="Pickup Name" component={PickupName} options={{ title: "PICKUP STORE", headerStyle: { backgroundColor: "#ccb46c" }, headerTitleAlign: 'center', headerTitleStyle: { color: 'white', fontWeight: 'bold' } }} /> <Stack.Screen name="Pickup Name" component={PickupName} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'PICKUP STORE'
}}/>
<Stack.Screen name="Outlet Detail" component={OutletDetail} /> <Stack.Screen name="Outlet Detail" component={OutletDetail} />
<Stack.Screen name="Menu Select" component={MenuSelection} options={{ headerShown: false }} /> <Stack.Screen name="Menu Select" component={MenuSelection} options={{ headerShown: false }} />
<Stack.Screen name="Card Info" component={CardInfo} /> <Stack.Screen name="Card Info" component={CardInfo} />
<Stack.Screen name="Shopping Cart" component={ShoppingCart} /> <Stack.Screen name="Shopping Cart" component={ShoppingCart} />
<Stack.Screen name="Order History" component={OrderHistory} /> <Stack.Screen name="Order History" component={OrderHistory} />
<Stack.Screen name="Reward History" component={RewardHistory} /> <Stack.Screen name="Reward History" component={RewardHistory} />
<Stack.Screen name="Order Detail" component={OrderDetail} options={({ navigation, route }) => ({ <Stack.Screen name="Order Detail" component={OrderDetail} options={({ navigation, route }) => ({
headerLeft: props => <HeaderBackButton {...props} onPress={() => navigation.navigate('Home', { screen: 'ORDER' })} />, headerLeft: props => <HeaderBackButton {...props} onPress={() => navigation.navigate('Home', { screen: 'ORDER' })} />,
...@@ -206,11 +288,52 @@ class Auth extends React.Component { ...@@ -206,11 +288,52 @@ class Auth extends React.Component {
} }
<Stack.Screen name="New Password" component={NewPassword} /> <Stack.Screen name="New Password" component={NewPassword} options={{
headerStyle: { backgroundColor: "#ccb46c" },
headerBackTitleStyle: { color: 'white' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
textAlign: 'center',
fontSize: 15,
fontFamily: 'Gotham-Black',
color: 'white'
},
headerTitle: 'New Password'
}} />
{/* <Stack.Screen name="Login" component={Login} /> */} {/* <Stack.Screen name="Login" component={Login} /> */}
<Stack.Screen name="Reset Password" component={ResetPassword} /> <Stack.Screen name="Reset Password" component={ResetPassword}
options={{
headerStyle: { backgroundColor: "#ccb46c" },
headerBackTitleStyle: { color: 'white' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
textAlign: 'center',
fontSize: 15,
fontFamily: 'Gotham-Black',
color: 'white'
},
headerTitle: 'RESET PASSWORD'
}} />
<Stack.Screen name="Verify Email" component={VerifyEmail} /> <Stack.Screen name="Verify Email" component={VerifyEmail} />
<Stack.Screen name="Change Email" component={ChangeEmail} /> <Stack.Screen name="Change Email" component={ChangeEmail} options={{
headerStyle: { backgroundColor: "#ccb46c" },
headerBackTitleStyle: { color: 'white' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
textAlign: 'center',
fontSize: 15,
fontFamily: 'Gotham-Black',
color: 'white'
},
headerTitle: 'CHANGE EMAIL'
}} />
{/* <Stack.Screen name="Card Activation" component={CardActivation} /> */} {/* <Stack.Screen name="Card Activation" component={CardActivation} /> */}
<Stack.Screen name="Confirm Mobile" component={ConfirmMobile} /> <Stack.Screen name="Confirm Mobile" component={ConfirmMobile} />
<Stack.Screen name="Balance" component={Balance} /> <Stack.Screen name="Balance" component={Balance} />
...@@ -220,16 +343,21 @@ class Auth extends React.Component { ...@@ -220,16 +343,21 @@ class Auth extends React.Component {
{/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */} {/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */}
<Stack.Screen name="News Detail" component={NewsDetail} /> <Stack.Screen name="News Detail" component={NewsDetail} />
{/* <Stack.Screen name="Delivery Address" component={DeliveryAddress} /> */}
<Stack.Screen name="Confirm Your Order" component={MenuConfirmation} /> <Stack.Screen name="Confirm Your Order" component={MenuConfirmation} />
{/* <Stack.Screen name="Card Info" component={CardInfo} /> */}
{/* <Stack.Screen name="Change password" component={ChangePassword} /> */}
<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}
options={{
headerStyle: { backgroundColor: "#ccb46c" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 20,
},
title: 'REGISTER'
}} />
<Stack.Screen name="TopUpInfo" component={TopUpInfo} /> <Stack.Screen name="TopUpInfo" component={TopUpInfo} />
<Stack.Screen name="Reward Detail" component={RewardDetail} /> <Stack.Screen name="Reward Detail" component={RewardDetail} />
<Stack.Screen name="Reward Select" component={RewardSelect} /> <Stack.Screen name="Reward Select" component={RewardSelect} />
......
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, TouchableOpacity, Image } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Axios from 'axios'; import Axios from 'axios';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import Spinner from 'react-native-loading-spinner-overlay';
class ChangeEmail extends React.Component { class ChangeEmail extends React.Component {
...@@ -47,27 +48,43 @@ class ChangeEmail extends React.Component { ...@@ -47,27 +48,43 @@ class ChangeEmail extends React.Component {
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <Spinner
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>Change Email</Text> visible={this.state.spinner}
</View> textContent={'Loading...'}
<View style={styles.form}> textStyle={styles.spinnerTextStyle}
<View style={styles.field_email}> />
<View style={{ width: 55, justifyContent: 'center' }}> <View style={{ flex: 3 }}>
<Text>Email</Text> <View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 50 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>New Email</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={(email) => this.setState({ email })}
value={this.state.email}
autoCapitalize="none"
value={this.state.email}
keyboardType='email-address' />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.changeEmail()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}>
<Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>SUBMIT</Text>
</View> </View>
<View style={{ flex: 1 }}> </TouchableOpacity>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }} </View>
onChangeText={(email) => this.setState({ email })} </View>
value={this.state.email} <View style={{ flex: 1, flexDirection: 'row' }}>
/>
</View> <View style={styles.v_logo}>
<View style={{ flex: 1, alignSelf: 'flex-start' }}>
<Image resizeMode="contain" source={require('../assets/images/daun.png')} style={styles.logo}></Image>
</View> </View>
<View style={styles.button}> <View style={{ flex: 1 }}>
<Button title="Submit" onPress={() => this.changeEmail()}></Button>
</View> </View>
</View> </View>
<View style={{ flex: 0.5 }}>
</View>
</View> </View>
</View>
) )
} }
} }
...@@ -86,6 +103,7 @@ const styles = StyleSheet.create({ ...@@ -86,6 +103,7 @@ const styles = StyleSheet.create({
form: { form: {
flex: 3, flex: 3,
top: 40,
margin: 10, margin: 10,
marginTop: 0, marginTop: 0,
}, },
...@@ -95,9 +113,22 @@ const styles = StyleSheet.create({ ...@@ -95,9 +113,22 @@ const styles = StyleSheet.create({
}, },
button: { button: {
height: 50, height: 40,
margin: 10, margin: 10,
},
logo: {
alignSelf: 'flex-start',
marginTop: 50,
width: 290,
height: 290,
bottom: 145,
},
v_logo: {
flex: 2,
flexDirection: 'column-reverse',
alignContent: 'flex-start',
} }
}) })
...@@ -126,4 +157,27 @@ const mapStateToProps = (state) => { ...@@ -126,4 +157,27 @@ const mapStateToProps = (state) => {
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(ChangeEmail); export default connect(mapStateToProps, mapDispatchToProps)(ChangeEmail);
\ No newline at end of file
{/* <View style={styles.header}>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>Change Email</Text>
</View>
<View style={styles.form}>
<View style={styles.field_email}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Email</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(email) => this.setState({ email })}
value={this.state.email}
/>
</View>
</View>
<View style={styles.button}>
<Button title="Submit" onPress={() => this.changeEmail()}></Button>
</View>
</View> */}
\ No newline at end of file
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { View, Text, button, StyleSheet, Button, TextInput, Picker, Alert } from 'react-native'; import { View, Text, button, StyleSheet, Button, Alert, TextInput, TouchableOpacity,Image,ScrollView,TouchableHighlight } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Axios from 'axios'; import Axios from 'axios';
import RNPickerSelect from 'react-native-picker-select'; import RNPickerSelect from 'react-native-picker-select';
...@@ -87,60 +87,65 @@ class ChangeProfil extends React.Component { ...@@ -87,60 +87,65 @@ class ChangeProfil extends React.Component {
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Text style={{ textAlign: "center", margin: 50, fontWeight: 'bold', fontSize: 25 }}> Change Profile </Text> <ScrollView>
<View style={{ margin: 10, flex: 1, }}> <View style={{ flex: 1, height: 90, top: 10 }}>
<View style={{ height: 50, flexDirection: 'row' }}> <View style={{ alignSelf: 'center' }}>
<Text style={{ fontSize: 20, margin: 5, flex: 1 }}>Name </Text> <Image
<TextInput style={{ height: 70, width: 70, top: 5, justifyContent: 'center' }}
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, flex: 2 }} source={require('../assets/images/people-actv.png')}
onChangeText={(full_name) => this.setState({ full_name })}
value={this.state.full_name}
/> />
</View> </View>
<View style={{ height: 50, flexDirection: 'row' }}> </View>
<Text style={{ fontSize: 20, margin: 5, flex: 1 }}>Date of {'\n'}Birth </Text> <View style={{ flex: 3 }}>
<Text style={{ fontSize: 15, margin: 5, borderWidth: 1, flex: 2, padding: 5 }}>{this.state.dob_day} - {this.state.dob_month} - {this.state.dob_year} </Text> <View style={{ flex: 1, margin: 20,top:20 }}>
</View> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Name</Text>
<View style={{ height: 50, flexDirection: 'row' }}> <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={{ flex: 1 }}> onChangeText={(full_name) => this.setState({ full_name })} value={this.state.full_name}>
<Text style={{ fontSize: 20, margin: 5, flex: 1 }}>Gender </Text> </TextInput>
</View> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Date of Birth</Text>
<View style={{ height: 50, flex: 1 }}> <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 }}
<RNPickerSelect editable={false}>
value={this.state.gender_selected} {this.state.dob_day} / {this.state.dob_month} / {this.state.dob_year}
// itemKey="1" </TextInput>
placeholderTextColor='gray' <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin:3 }}>Gender</Text>
onValueChange={(value) => this.setState({ gender_selected: value })} <View style={{justifyContent:'center',borderRadius:10,borderWidth:1,borderColor:'grey',height:40,marginRight:10,marginLeft:10}}>
items={this.state.gender} /> <RNPickerSelect
</View> value={this.state.gender_selected}
</View> // itemKey="1"
<View style={{ height: 50, flexDirection: 'row' }}> placeholderTextColor='gray'
<Text style={{ fontSize: 20, margin: 5, flex: 1 }}>Email </Text> onValueChange={(value) => this.setState({ gender_selected: value })}
<TextInput items={this.state.gender} />
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, flex: 2 }}
onChangeText={(full_name) => this.setState({ full_name })}
value={this.state.email}
/>
</View>
<View style={{ height: 50, flexDirection: 'row' }}>
<Text style={{ fontSize: 20, margin: 5, flex: 1 }}>Mobile phone </Text>
<TextInput
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, flex: 2, margin: 10 }}
onChangeText={(no_tlp) => this.setState({ no_tlp })}
value={this.state.no_tlp}
/>
</View> </View>
<View style={{ flexDirection: 'row', top: 0, margin: 10, }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Mobile</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={true}>
</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 }}> <View style={{ flex: 1, margin: 5 }}>
<Button title="Save" onPress={() => this.saveData()}></Button> <TouchableOpacity title="Edit" onPress={() => this.saveData()}>
<View style={{ height: 60, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 19, textAlign: 'center', margin: 15 }}>Save</Text>
</View>
</TouchableOpacity>
</View> </View>
<View style={{ flex: 1, margin: 5 }}> <View style={{ flex: 1, margin: 5 }}>
<Button title="Cancel"></Button> <TouchableOpacity title="Edit" onPress={() => this.props.navigation.navigate('Profile')}>
<View style={{ height: 60, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 19, textAlign: 'center', margin: 15 }}>Cancel</Text>
</View>
</TouchableOpacity>
</View> </View>
</View> </View>
</View> </View>
</View> </View>
</ScrollView>
</View>
) )
} }
} }
...@@ -150,7 +155,7 @@ const styles = StyleSheet.create({ ...@@ -150,7 +155,7 @@ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
backgroundColor: 'white', backgroundColor: 'white',
} }
}) })
...@@ -168,12 +173,67 @@ const mapDispatchToProps = (dispacth) => { ...@@ -168,12 +173,67 @@ const mapDispatchToProps = (dispacth) => {
} }
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
session_id: state.session_id, session_id: state.session_id,
gender_display: state.gender_display, gender_display: state.gender_display,
full_name: state.full_name full_name: state.full_name
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(ChangeProfil); export default connect(mapStateToProps, mapDispatchToProps)(ChangeProfil);
\ No newline at end of file // <View style={styles.container}>
// <Text style={{ textAlign: "center", margin: 50, fontWeight: 'bold', fontSize: 25 }}> Change Profile </Text>
// <View style={{ margin: 10, flex: 1, }}>
// <View style={{ height: 50, flexDirection: 'row' }}>
// <Text style={{ fontSize: 20, margin: 5, flex: 1 }}>Name </Text>
// <TextInput
// style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, flex: 2 }}
// onChangeText={(full_name) => this.setState({ full_name })}
// value={this.state.full_name}
// />
// </View>
// <View style={{ height: 50, flexDirection: 'row' }}>
// <Text style={{ fontSize: 20, margin: 5, flex: 1 }}>Date of {'\n'}Birth </Text>
// <Text style={{ fontSize: 15, margin: 5, borderWidth: 1, flex: 2, padding: 5 }}>{this.state.dob_day} - {this.state.dob_month} - {this.state.dob_year} </Text>
// </View>
// <View style={{ height: 50, flexDirection: 'row' }}>
// <View style={{ flex: 1 }}>
// <Text style={{ fontSize: 20, margin: 5, flex: 1 }}>Gender </Text>
// </View>
// <View style={{ height: 50, flex: 1 }}>
// <RNPickerSelect
// value={this.state.gender_selected}
// // itemKey="1"
// placeholderTextColor='gray'
// onValueChange={(value) => this.setState({ gender_selected: value })}
// items={this.state.gender} />
// </View>
// </View>
// <View style={{ height: 50, flexDirection: 'row' }}>
// <Text style={{ fontSize: 20, margin: 5, flex: 1 }}>Email </Text>
// <TextInput
// style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, flex: 2 }}
// onChangeText={(full_name) => this.setState({ full_name })}
// value={this.state.email}
// />
// </View>
// <View style={{ height: 50, flexDirection: 'row' }}>
// <Text style={{ fontSize: 20, margin: 5, flex: 1 }}>Mobile phone </Text>
// <TextInput
// style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5, flex: 2, margin: 10 }}
// onChangeText={(no_tlp) => this.setState({ no_tlp })}
// value={this.state.no_tlp}
// />
// </View>
// <View style={{ flexDirection: 'row', top: 0, margin: 10, }}>
// <View style={{ flex: 1, margin: 5 }}>
// <Button title="Save" onPress={() => this.saveData()}></Button>
// </View>
// <View style={{ flex: 1, margin: 5 }}>
// <Button title="Cancel"></Button>
// </View>
// </View>
// </View>
// </View>
\ No newline at end of file
import * as React from 'react'; import * as React from 'react';
import { Button, View, Text, StyleSheet, TextInput, Alert } from 'react-native'; import { Button, View, Text, StyleSheet, TextInput, Alert, Image } from 'react-native';
import { TouchableOpacity } from 'react-native-gesture-handler'; import { TouchableOpacity } from 'react-native-gesture-handler';
import Axios from 'axios'; import Axios from 'axios';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
...@@ -66,7 +66,7 @@ class EmailConfirmation extends React.Component { ...@@ -66,7 +66,7 @@ class EmailConfirmation extends React.Component {
index: 0, index: 0,
routes: [ routes: [
{ {
name: 'Home', name: 'Welcome log',
}, },
], ],
}) })
...@@ -97,7 +97,7 @@ class EmailConfirmation extends React.Component { ...@@ -97,7 +97,7 @@ class EmailConfirmation extends React.Component {
index: 0, index: 0,
routes: [ routes: [
{ {
name: 'Login', name: 'Welcomes',
}, },
], ],
}) })
...@@ -161,28 +161,45 @@ class EmailConfirmation extends React.Component { ...@@ -161,28 +161,45 @@ class EmailConfirmation extends React.Component {
textContent={'Loading...'} textContent={'Loading...'}
textStyle={styles.spinnerTextStyle} textStyle={styles.spinnerTextStyle}
/> />
<View style={{ margin: 10, top: 10 }}> <View style={{ flex: 3 }}>
<TextInput <View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 60 }}>
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5 }} <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Token</Text>
onChangeText={(confirmation_number) => this.setState({ confirmation_number })} <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 }}
value={this.state.confirmation_number} onChangeText={(confirmation_number) => this.setState({ confirmation_number })}
/> value={this.state.confirmation_number}
autoCapitalize="none"
value={this.state.email}
keyboardType='email-address' />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.handleSubmit()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 10, borderRadius: 10, marginRight: 50, marginLeft: 50 }}>
<Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>SUBMIT</Text>
</View>
</TouchableOpacity>
<TouchableOpacity style={{ height: 100 }} onPress={() => this.handleCancel()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 10, borderRadius: 10, marginRight: 50, marginLeft: 50 }}>
<Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>CANCEL</Text>
</View>
</TouchableOpacity>
<TouchableOpacity style={{ height: 60}} onPress={() => this.handleResend()}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20 ,top:10}}>RESEND EMAIL TOKEN</Text>
</TouchableOpacity>
<TouchableOpacity style={{ height: 60}} onPress={() => this.props.navigation.navigate('Change Email')}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20, }}>CHANGE EMAIL</Text>
</TouchableOpacity>
</View>
</View> </View>
<View style={{ margin: 10 }}> <View style={{ flex: 1, flexDirection: 'row' }}>
<Button title="Submit" onPress={() => this.handleSubmit()} /> <View style={styles.v_logo}>
</View> <View style={{ flex: 1, alignSelf: 'flex-start' }}>
<View style={{ margin: 10 }}> <Image resizeMode="contain" source={require('../assets/images/daun.png')} style={styles.logo}></Image>
<Button title="Cancel" onPress={() => this.handleCancel()} /> </View>
</View> <View style={{ flex: 1 }}>
<View>
<TouchableOpacity onPress={() => this.handleResend()}> </View>
<Text style={{ color: 'red', textAlign: 'center' }}>Resend email token</Text> </View>
</TouchableOpacity>
</View> <View style={{ flex: 0.5 }}>
<View> </View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Change Email')}>
<Text style={{ color: 'red', textAlign: 'center' }}> Change email</Text>
</TouchableOpacity>
</View> </View>
</View> </View>
) )
...@@ -191,9 +208,45 @@ class EmailConfirmation extends React.Component { ...@@ -191,9 +208,45 @@ class EmailConfirmation extends React.Component {
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
backgroundColor: 'white' backgroundColor: '#ffff'
},
header: {
flex: 0.5,
margin: 10,
},
form: {
flex: 3,
top: 40,
margin: 10,
marginTop: 0,
},
field_email: {
flexDirection: 'row'
},
button: {
height: 40,
margin: 10,
},
logo: {
alignSelf: 'flex-start',
marginTop: 50,
width: 290,
height: 290,
bottom: 145,
},
v_logo: {
flex: 2,
flexDirection: 'column-reverse',
alignContent: 'flex-start',
} }
}) })
...@@ -248,4 +301,34 @@ const mapDispatchToProps = (dispacth) => { ...@@ -248,4 +301,34 @@ const mapDispatchToProps = (dispacth) => {
} }
export default connect(mapStateToProps,mapDispatchToProps)(EmailConfirmation); export default connect(mapStateToProps,mapDispatchToProps)(EmailConfirmation);
\ No newline at end of file
{/* <Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
/>
<View style={{ margin: 10, top: 10 }}>
<TextInput
style={{ height: 40, borderColor: 'gray', borderWidth: 1, padding: 5 }}
onChangeText={(confirmation_number) => this.setState({ confirmation_number })}
value={this.state.confirmation_number}
/>
</View>
<View style={{ margin: 10 }}>
<Button title="Submit" onPress={() => this.handleSubmit()} />
</View>
<View style={{ margin: 10 }}>
<Button title="Cancel" onPress={() => this.handleCancel()} />
</View>
<View>
<TouchableOpacity onPress={() => this.handleResend()}>
<Text style={{ color: 'red', textAlign: 'center' }}>Resend email token</Text>
</TouchableOpacity>
</View>
<View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Change Email')}>
<Text style={{ color: 'red', textAlign: 'center' }}> Change email</Text>
</TouchableOpacity>
</View> */}
\ No newline at end of file
...@@ -37,11 +37,9 @@ class Home extends React.Component { ...@@ -37,11 +37,9 @@ class Home extends React.Component {
} }
componentDidMount() { componentDidMount() {
console.log("INI BUILD VERSION : " + Constants.nativeBuildVersio)
this._account(); this._account();
this._getPermissions() this._getPermissions()
this._renderCarousell() this._renderCarousell()
console.log("INI LAT : " + this.props.lat)
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({ this.setState({
...@@ -109,6 +107,11 @@ class Home extends React.Component { ...@@ -109,6 +107,11 @@ class Home extends React.Component {
this.setState({ this.setState({
images: imageLink images: imageLink
}) })
}).catch(error =>{
const { navigation } = this.props
let response = error.response.data
session(response, navigation)
}) })
} }
...@@ -123,7 +126,7 @@ class Home extends React.Component { ...@@ -123,7 +126,7 @@ class Home extends React.Component {
let point = dataCard.kaspro_point let point = dataCard.kaspro_point
let balance = dataCard.kaspro_balance let balance = dataCard.kaspro_balance
let expire = dataCard.expire_date let expire = dataCard.expire_date
let account_number = dataCard.kaspro_account_number let account_number = dataCard.card_number
this.setState({ this.setState({
point: point, point: point,
...@@ -133,10 +136,11 @@ class Home extends React.Component { ...@@ -133,10 +136,11 @@ class Home extends React.Component {
indicator: false indicator: false
}) })
}).catch(error => { }).catch(error => {
const { navigation } = this.props // console.log("INI ERROR " + error);
let response = error.response.data // const { navigation } = this.props
session(response, navigation) // let response = error.response.data
Alert.alert(response.msg); // session(response, navigation)
// Alert.alert(response.msg);
}) })
} }
...@@ -162,10 +166,12 @@ class Home extends React.Component { ...@@ -162,10 +166,12 @@ class Home extends React.Component {
indicator: false indicator: false
}) })
}).catch(error => { }).catch(error => {
const { navigation } = this.props const { navigation } = this.props
let response = error.response.data let response_data = error.response.data
session(response, navigation) let error_status = error.response.status
Alert.alert(response.msg); session(response_data,error_status,navigation)
}) })
} }
...@@ -374,10 +380,6 @@ class Home extends React.Component { ...@@ -374,10 +380,6 @@ class Home extends React.Component {
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{top:20}}>
<Text> App version : {version} </Text>
<Text> Expo build version : {buildNumber} </Text>
</View>
<View style={{ height: 60 }}></View> <View style={{ height: 60 }}></View>
</View> </View>
</View> </View>
......
import * as React from 'react'; import * as React from 'react';
import { Button, View, Text, TextInput, StyleSheet, Alert, Platform, Image, TouchableOpacity, StatusBar, ImageBackground } from 'react-native'; import { Button, View, Text, TextInput, StyleSheet, Alert, Platform, Image, TouchableOpacity, StatusBar, ImageBackground,ScrollView } from 'react-native';
import Axios from 'axios'; import Axios from 'axios';
import Constants from 'expo-constants'; import Constants from 'expo-constants';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import { BASE_URL_LOGIN } from '../model/Base_Model'; import { BASE_URL_LOGIN } from '../model/Base_Model';
import { Notifications } from 'expo'; import { Notifications } from 'expo';
import Spinner from 'react-native-loading-spinner-overlay';
class Login extends React.Component { class Login extends React.Component {
constructor(props) { constructor(props) {
...@@ -138,13 +138,13 @@ class Login extends React.Component { ...@@ -138,13 +138,13 @@ class Login extends React.Component {
index: 0, index: 0,
routes: [ routes: [
{ {
name: 'Home', name: 'Welcome log',
params: { someParam: 'Param1' }, params: { someParam: 'Param1' },
}, },
], ],
}) })
console.log("INI SESSION : " + this.props.session_id)
}).catch(error => { }).catch(error => {
...@@ -181,13 +181,17 @@ class Login extends React.Component { ...@@ -181,13 +181,17 @@ class Login extends React.Component {
} }
} }
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
/>
<StatusBar <StatusBar
hidden={true} /> hidden={true} />
<ImageBackground source={require('../assets/images/loging-background.jpg')} style={{ width: '100%', height: '100%' }}> <ImageBackground source={require('../assets/images/loging-background.jpg')} style={{ width: '100%', height: '100%' }}>
<View style={styles.logo}> <View style={styles.logo}>
<Image source={require('../assets/images/excelso-log.png')} style={styles.imageslogo}></Image> <Image source={require('../assets/images/excelso-log.png')} style={styles.imageslogo}></Image>
...@@ -253,7 +257,7 @@ const styles = StyleSheet.create({ ...@@ -253,7 +257,7 @@ const styles = StyleSheet.create({
height: 50 height: 50
}, },
imageslogo: { imageslogo: {
height: 170, height: 150,
margin: 10, margin: 10,
width: 150, width: 150,
justifyContent: 'center', justifyContent: 'center',
......
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, TouchableOpacity, Image } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Axios from 'axios'; import Axios from 'axios';
import { BASE_URL_NEW_PASSWORD } from '../model/Base_Model' import { BASE_URL_NEW_PASSWORD } from '../model/Base_Model'
import Spinner from 'react-native-loading-spinner-overlay'; import Spinner from 'react-native-loading-spinner-overlay';
class NewPassword extends React.Component { class NewPassword extends React.Component {
...@@ -17,11 +17,11 @@ class NewPassword extends React.Component { ...@@ -17,11 +17,11 @@ class NewPassword extends React.Component {
} }
} }
componentDidMount(){ componentDidMount() {
// console.log(this.props) // console.log(this.props)
} }
validation(){ validation() {
this.setState({ this.setState({
spinner: true, spinner: true,
}) })
...@@ -34,8 +34,8 @@ class NewPassword extends React.Component { ...@@ -34,8 +34,8 @@ class NewPassword extends React.Component {
'Password harus sama!' 'Password harus sama!'
, ,
) )
}else{ } else {
this.handleResetPassword(); this.handleResetPassword();
} }
} }
...@@ -51,11 +51,11 @@ class NewPassword extends React.Component { ...@@ -51,11 +51,11 @@ class NewPassword extends React.Component {
'password_confirmation': this.state.password_confirmation 'password_confirmation': this.state.password_confirmation
} }
// console.log(params); // console.log(params);
Axios.post(BASE_URL_NEW_PASSWORD,params).then(res => { Axios.post(BASE_URL_NEW_PASSWORD, params).then(res => {
this.setState({ this.setState({
spinner: false, spinner: false,
}) })
this.props.navigation.navigate('Login') this.props.navigation.navigate('Login')
}).catch(error => { }).catch(error => {
this.setState({ this.setState({
spinner: false, spinner: false,
...@@ -68,50 +68,45 @@ class NewPassword extends React.Component { ...@@ -68,50 +68,45 @@ class NewPassword extends React.Component {
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Spinner <Spinner
visible={this.state.spinner} visible={this.state.spinner}
textContent={'Loading...'} textContent={'Loading...'}
textStyle={styles.spinnerTextStyle} textStyle={styles.spinnerTextStyle}
/> />
{/* <Text>{this.state.email}</Text> */} <View style={{ flex: 3}}>
<View style={styles.header}> <View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 50 }}>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>New Password</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Token</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.form}>
<View style={styles.field_token}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Token</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(confirmation_number) => this.setState({ confirmation_number })} onChangeText={(confirmation_number) => this.setState({ confirmation_number })}
value={this.state.confirmation_number} /> value={this.state.confirmation_number} />
</View> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>New Password</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_new_password}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>New Password</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(password) => this.setState({ password })} onChangeText={(password) => this.setState({ password })}
value={this.state.password} value={this.state.password}
secureTextEntry={true}/> secureTextEntry={true} />
</View> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Repeat Password</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={(password_confirmation) => this.setState({ password_confirmation })}
value={this.state.password_confirmation}
secureTextEntry={true} />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.handleResetPassword()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}>
<Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>SUBMIT</Text>
</View>
</TouchableOpacity>
</View> </View>
<View style={styles.field_repeat_password}> </View>
<View style={{ width: 55, justifyContent: 'center' }}> <View style={{ flex: 1, flexDirection: 'row' }}>
<Text>Repeat Password</Text> <View style={styles.v_logo}>
<View style={{ flex: 1, alignSelf: 'flex-start' }}>
<Image resizeMode="contain" source={require('../assets/images/daun.png')} style={styles.logo}></Image>
</View> </View>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(password_confirmation) => this.setState({ password_confirmation })}
value={this.state.password_confirmation}
secureTextEntry={true}/>
</View> </View>
</View> </View>
<View style={styles.button}>
<Button title="Submit" onPress={() => this.validation()}></Button> <View style={{ flex: 0.5 }}>
</View> </View>
</View> </View>
</View> </View>
...@@ -126,41 +121,82 @@ const styles = StyleSheet.create({ ...@@ -126,41 +121,82 @@ const styles = StyleSheet.create({
backgroundColor: '#ffff' backgroundColor: '#ffff'
}, },
header: {
flex: 0.5,
margin: 10,
},
form: { form: {
flex: 3, flex: 3,
margin: 10, margin: 10,
marginTop: 0, marginTop: 0,
}, },
field_token: {
flexDirection: 'row'
},
field_new_password: { v_logo: {
flexDirection: 'row' flex: 2,
flexDirection: 'column-reverse',
alignContent: 'flex-start',
}, },
logo: {
alignSelf: 'flex-start',
marginTop: 50,
width: 290,
height: 290,
bottom: 150,
field_repeat_password: {
flexDirection: 'row'
}, },
button: {
height: 50,
margin: 10,
}
}) })
const mapStateToProps = (state) => { console.log(JSON.stringify(state)) const mapStateToProps = (state) => {
console.log(JSON.stringify(state))
return { return {
email: state.email email: state.email
} }
} }
export default connect(mapStateToProps)(NewPassword); export default connect(mapStateToProps)(NewPassword);
\ No newline at end of file
{/* <Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
/>
<View style={styles.header}>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>New Password</Text>
</View>
<View style={styles.form}>
<View style={styles.field_token}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Token</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(confirmation_number) => this.setState({ confirmation_number })}
value={this.state.confirmation_number} />
</View>
</View>
<View style={styles.field_new_password}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>New Password</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(password) => this.setState({ password })}
value={this.state.password}
secureTextEntry={true}/>
</View>
</View>
<View style={styles.field_repeat_password}>
<View style={{ width: 55, justifyContent: 'center' }}>
<Text>Repeat Password</Text>
</View>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(password_confirmation) => this.setState({ password_confirmation })}
value={this.state.password_confirmation}
secureTextEntry={true}/>
</View>
</View>
<View style={styles.button}>
<Button title="Submit" onPress={() => this.validation()}></Button>
</View>
</View> */}
\ No newline at end of file
...@@ -236,11 +236,6 @@ class NewRegister extends React.Component { ...@@ -236,11 +236,6 @@ class NewRegister extends React.Component {
textContent={'Loading...'} textContent={'Loading...'}
textStyle={styles.spinnerTextStyle} textStyle={styles.spinnerTextStyle}
/> />
<View style={styles.header}>
<StatusBar barStyle='dark-content' />
{/* <Text style={styles.titleText}>{i18n.t('register')}</Text> */}
<Text style={styles.titleText}>REGISTER</Text>
</View>
<View style={styles.body}> <View style={styles.body}>
<View style={styles.itemsRow}> <View style={styles.itemsRow}>
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { View, Text, button, StyleSheet, Button, Alert } from 'react-native'; import { View, Text, button, StyleSheet, Button, Alert, TextInput, TouchableOpacity,Image } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import Axios from 'axios'; import Axios from 'axios';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import i18n from 'i18n-js'; import i18n from 'i18n-js';
import { StackActions } from '@react-navigation/native'; import { StackActions } from '@react-navigation/native';
import { ScrollView, TouchableHighlight } from 'react-native-gesture-handler';
class ProfilePage extends PureComponent { class ProfilePage extends PureComponent {
constructor(props) { constructor(props) {
...@@ -16,6 +17,7 @@ class ProfilePage extends PureComponent { ...@@ -16,6 +17,7 @@ class ProfilePage extends PureComponent {
dob_year: '', dob_year: '',
gender: '', gender: '',
email: '', email: '',
onClicked: false,
} }
} }
...@@ -54,6 +56,9 @@ class ProfilePage extends PureComponent { ...@@ -54,6 +56,9 @@ class ProfilePage extends PureComponent {
} }
handleChangeProfil() { handleChangeProfil() {
this.setState({
onClicked:true
})
this.props.navigation.navigate('Change Profil', { 'data': 'sample', onChangeProfil: this.onChangeProfil }) this.props.navigation.navigate('Change Profil', { 'data': 'sample', onChangeProfil: this.onChangeProfil })
} }
...@@ -75,59 +80,89 @@ class ProfilePage extends PureComponent { ...@@ -75,59 +80,89 @@ class ProfilePage extends PureComponent {
navigation.reset({ navigation.reset({
index: 0, index: 0,
routes: [ routes: [
{ {
name: 'Login', name: 'Login',
params: { someParam: 'Param1' }, params: { someParam: 'Param1' },
}, },
], ],
}) })
} }
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Text style={{ textAlign: "center", margin: 50, fontWeight: 'bold', fontSize: 25 }}> Profil </Text> <ScrollView>
<View style={{ margin: 10, flex: 1, }}> <View style={{ flex: 1, height: 90, top: 10 }}>
<View style={{ height: 50, flexDirection: 'row' }}> <View style={{ alignSelf: 'center' }}>
<Image
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>Name : </Text> style={{ height: 70, width: 70, top: 5, justifyContent: 'center' }}
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>{this.state.full_name} </Text> source={require('../assets/images/people-actv.png')}
</View> />
<View style={{ height: 50, flexDirection: 'row' }}> </View>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>Date of Birth </Text>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>{this.state.dob_day} / {this.state.dob_month} / {this.state.dob_year} </Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center', margin: 15 }}>
</View> {this.state.full_name}
<View style={{ height: 50, flexDirection: 'row' }}> </Text>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>Gender :</Text>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>{this.state.gender} </Text>
</View>
<View style={{ height: 50, flexDirection: 'row' }}>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>Email :</Text>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>{this.state.email} </Text>
</View>
</View> </View>
<View style={{ flexDirection: 'row', top: 20, margin: 5, }}> <View style={{ flex: 3 }}>
<View style={{ flex: 1, margin: 5 }}> <View style={{ flex: 1, margin: 20,top:20 }}>
<Button title="Edit" onPress={() => this.handleChangeProfil()}></Button> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Email</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={{ flex: 1, margin: 5 }}> editable={false} value={this.state.email}>
<Button title="Change Password" onPress={() => this.props.navigation.navigate('Change password')}></Button> </TextInput>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Date of Birth</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 }}
editable={false}>
{this.state.dob_day} / {this.state.dob_month} / {this.state.dob_year}
</TextInput>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Gender</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 }}
editable={false} value={this.state.gender}>
</TextInput>
</View> </View>
</View> </View>
<View style={{ flex: 1, flexDirection: 'row', top: 20, margin: 5 }}> <View style={{ flex: 2 }}>
<View style={{ flex: 1, margin: 5 }}> <View style={{ flex: 1 }}>
<Button title="Language" onPress={() => this.props.navigation.navigate('Change language')}></Button> <View style={{ flexDirection: 'row', top: 10, margin: 5,marginRight:20,marginLeft:20 }}>
</View> <View style={{ flex: 1, margin: 5 }}>
<View style={{ flex: 1, margin: 5 }}> <TouchableHighlight title="Edit" onPress={() => this.handleChangeProfil()}>
<Button title="Logout" onPress={() => this.logout()}></Button> <View style={{ height: 60, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 19, textAlign: 'center', margin: 15 }}>Edit</Text>
</View>
</TouchableHighlight>
</View>
<View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity title="Edit" onPress={() => this.props.navigation.navigate('Change password')}>
<View style={{ height: 60, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center', margin: 15 }}>Change Password</Text>
</View>
</TouchableOpacity>
</View>
</View>
<View style={{ flex: 1, flexDirection: 'row', top: 10, margin: 5, marginRight:20,marginLeft:20 }}>
<View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity title="Edit" onPress={() => this.props.navigation.navigate('Change language')}>
<View style={{ height: 60, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 19, textAlign: 'center', margin: 15 }}>Language</Text>
</View>
</TouchableOpacity>
</View>
<View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity title="Edit" onPress={() => this.logout()}>
<View style={{ height: 60, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 19, textAlign: 'center', margin: 15 }}>Logout</Text>
</View>
</TouchableOpacity>
</View>
</View>
</View> </View>
</View> </View>
</ScrollView>
</View> </View>
) )
} }
} }
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
flex: 1, flex: 1,
...@@ -158,3 +193,38 @@ const mapStateToProps = (state) => { ...@@ -158,3 +193,38 @@ const mapStateToProps = (state) => {
} }
export default connect(mapStateToProps, mapDispatchToProps)(ProfilePage); export default connect(mapStateToProps, mapDispatchToProps)(ProfilePage);
{/* <View style={{ margin: 10, flex: 1, }}>
<View style={{ height: 50 }}>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>Name : </Text>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>{this.state.full_name} </Text>
</View>
<View style={{ height: 50, flexDirection: 'row' }}>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>Date of Birth </Text>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>{this.state.dob_day} / {this.state.dob_month} / {this.state.dob_year} </Text>
</View>
<View style={{ height: 50, flexDirection: 'row' }}>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>Gender :</Text>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>{this.state.gender} </Text>
</View>
<View style={{ height: 50, flexDirection: 'row' }}>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>Email :</Text>
<Text style={{ fontSize: 20, margin: 5, flex: 2 }}>{this.state.email} </Text>
</View>
</View>
<View style={{ flexDirection: 'row', top: 20, margin: 5, }}>
<View style={{ flex: 1, margin: 5 }}>
<Button title="Edit" onPress={() => this.handleChangeProfil()}></Button>
</View>
<View style={{ flex: 1, margin: 5 }}>
<Button title="Change Password" onPress={() => this.props.navigation.navigate('Change password')}></Button>
</View>
</View>
<View style={{ flex: 1, flexDirection: 'row', top: 20, margin: 5 }}>
<View style={{ flex: 1, margin: 5 }}>
<Button title="Language" onPress={() => this.props.navigation.navigate('Change language')}></Button>
</View>
<View style={{ flex: 1, margin: 5 }}>
<Button title="Logout" onPress={() => this.logout()}></Button>
</View>
</View> */}
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, Image, TouchableOpacity } from 'react-native';
import Axios from 'axios'; import Axios from 'axios';
import { BASE_URL_RESET_PASSWORD } from '../model/Base_Model'; import { BASE_URL_RESET_PASSWORD } from '../model/Base_Model';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { TouchableOpacity } from 'react-native-gesture-handler';
import i18n from 'i18n-js'; import i18n from 'i18n-js';
import Spinner from 'react-native-loading-spinner-overlay'; import Spinner from 'react-native-loading-spinner-overlay';
...@@ -14,7 +13,7 @@ class ResetPassword extends React.Component { ...@@ -14,7 +13,7 @@ class ResetPassword extends React.Component {
this.state = { this.state = {
email: '', email: '',
language: 'id', language: 'id',
spinner:false spinner: false
} }
} }
...@@ -40,7 +39,7 @@ class ResetPassword extends React.Component { ...@@ -40,7 +39,7 @@ class ResetPassword extends React.Component {
'Email terkirim, mohon dicek' 'Email terkirim, mohon dicek'
, ,
) )
this.props.navigation.navigate('New Password'); this.props.navigation.navigate('New Password');
} }
}).catch(error => { }).catch(error => {
...@@ -56,33 +55,43 @@ class ResetPassword extends React.Component { ...@@ -56,33 +55,43 @@ class ResetPassword extends React.Component {
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Spinner <Spinner
visible={this.state.spinner} visible={this.state.spinner}
textContent={'Loading...'} textContent={'Loading...'}
textStyle={styles.spinnerTextStyle} textStyle={styles.spinnerTextStyle}
/> />
<View style={styles.header}> <View style={{ flex: 3 }}>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>{i18n.t('resetPassword')}</Text> <View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 50 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Email</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={(email) => this.setState({ email })}
autoCapitalize="none"
value={this.state.email}
keyboardType='email-address' />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.handleResetPassword()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 20, borderRadius: 10, marginRight: 50, marginLeft: 50 }}>
<Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>SUBMIT</Text>
</View>
</TouchableOpacity>
<TouchableOpacity style={{ height: 60}} onPress={() => this.handleResetPassword()}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20 }}>ENTER TOKEN</Text>
</TouchableOpacity>
</View>
</View> </View>
<View style={styles.form}> <View style={{ flex: 1, flexDirection: 'row' }}>
<View style={styles.field_email}>
<View style={{ width: 40, justifyContent: 'center' }}> <View style={styles.v_logo}>
<Text>Email</Text> <View style={{ flex: 1, alignSelf: 'flex-start' }}>
<Image resizeMode="contain" source={require('../assets/images/daun.png')} style={styles.logo}></Image>
</View> </View>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10 }}
onChangeText={(email) => this.setState({ email })}
autoCapitalize="none"
value={this.state.email}
keyboardType='email-address'/>
</View> </View>
</View> </View>
<View style={styles.button}>
<Button title={i18n.t('submit')} onPress={() => this.handleResetPassword()}></Button> <View style={{ flex: 0.5 }}>
</View> </View>
<TouchableOpacity onPress={() => this.handleResetPassword()}>
<Text style={{ fontSize: 20, textAlign: 'center', color: 'red' }}>{i18n.t('enterToken')}</Text>
</TouchableOpacity>
</View> </View>
</View> </View>
) )
...@@ -103,6 +112,7 @@ const styles = StyleSheet.create({ ...@@ -103,6 +112,7 @@ const styles = StyleSheet.create({
form: { form: {
flex: 3, flex: 3,
top: 40,
margin: 10, margin: 10,
marginTop: 0, marginTop: 0,
}, },
...@@ -115,6 +125,19 @@ const styles = StyleSheet.create({ ...@@ -115,6 +125,19 @@ const styles = StyleSheet.create({
height: 40, height: 40,
margin: 10, margin: 10,
},
logo: {
alignSelf: 'flex-start',
marginTop: 50,
width: 290,
height: 290,
bottom: 145,
},
v_logo: {
flex: 2,
flexDirection: 'column-reverse',
alignContent: 'flex-start',
} }
}) })
...@@ -136,4 +159,30 @@ const mapDispatchToProps = (dispacth) => { ...@@ -136,4 +159,30 @@ const mapDispatchToProps = (dispacth) => {
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(ResetPassword); export default connect(mapStateToProps, mapDispatchToProps)(ResetPassword);
\ No newline at end of file
{/* <Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
/>
<Text style={{ textAlign: 'center', marginTop: 10, fontSize: 25 }}>{i18n.t('resetPassword')}</Text>
<View style={styles.form}>
<View style={styles.field_email}>
<View style={{ flex: 1 }}>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, margin: 10, borderRadius:20 }}
onChangeText={(email) => this.setState({ email })}
autoCapitalize="none"
value={this.state.email}
keyboardType='email-address'/>
</View>
</View>
<View style={styles.button}>
<Button title={i18n.t('submit')} onPress={() => this.handleResetPassword()}></Button>
<View></View>
</View>
<TouchableOpacity onPress={() => this.handleResetPassword()}>
<Text style={{ fontSize: 20, textAlign: 'center', color: 'red' }}>{i18n.t('enterToken')}</Text>
</TouchableOpacity>
</View> */}
\ No newline at end of file
...@@ -414,11 +414,17 @@ class ShoppingCart extends React.Component { ...@@ -414,11 +414,17 @@ class ShoppingCart extends React.Component {
return ( return (
<ScrollView style={styles.container}> <ScrollView style={styles.container}>
<View style={{ flexDirection: 'row', justifyContent: 'center' }}> <View style={{ flexDirection: 'row', justifyContent: 'center' }}>
<TouchableOpacity style={styles.buttonDelivery} onPress={() => this.checkChangeTrans('delivery')}> {/* <TouchableOpacity style={styles.buttonDelivery} onPress={() => this.checkChangeTrans('delivery')}>
<Text style={{ textAlign: 'center', color: '#354175', fontWeight: 'bold' }}>{i18n.t('delivery')}</Text> <Text style={{ textAlign: 'center', color: '#354175', fontWeight: 'bold' }}>{i18n.t('delivery')}</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={styles.buttonPickup} onPress={() => this.checkChangeTrans('pickup')}> <TouchableOpacity style={styles.buttonPickup} onPress={() => this.checkChangeTrans('pickup')}>
<Text style={{ textAlign: 'center', color: '#fff', fontWeight: 'bold' }}>{i18n.t('pickup')}</Text> <Text style={{ textAlign: 'center', color: '#fff', fontWeight: 'bold' }}>{i18n.t('pickup')}</Text>
</TouchableOpacity> */}
<TouchableOpacity style={styles.buttonDelivery} onPress={() => this.checkChangeTrans('delivery')}>
<Text style={{ textAlign: 'center', color: '#354175', fontWeight: 'bold', fontFamily: 'Gotham-Black' }}>DELIVERY</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonPickup} onPress={() => this.checkChangeTrans('pickup')}>
<Text style={{ textAlign: 'center', color: '#fff', fontWeight: 'bold', fontFamily: 'Gotham-Black' }}>PICKUP</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{ alignItems: 'center' }}> <View style={{ alignItems: 'center' }}>
...@@ -426,8 +432,8 @@ class ShoppingCart extends React.Component { ...@@ -426,8 +432,8 @@ class ShoppingCart extends React.Component {
this.props.type_pickup == true ? ( this.props.type_pickup == true ? (
<Card style={{ margin: 5, padding: 10 }}> <Card style={{ margin: 5, padding: 10 }}>
<Text style={{ textAlign: 'center' }}> Ambil pesanan kamu di</Text> <Text style={{ textAlign: 'center', fontFamily: 'Gotham-Light' }}> Ambil pesanan kamu di</Text>
<Text style={{ textAlign: 'center', fontSize: 12, top: 5, fontWeight: 'bold' }}>Excelso {this.props.name_outlet}</Text> <Text style={{ textAlign: 'center', fontSize: 12, top: 5, fontWeight: 'bold', fontFamily: 'Gotham-Black' }}>Excelso {this.props.name_outlet}</Text>
</Card> </Card>
) : ( ) : (
<Card style={{ margin: 5, padding: 10 }}> <Card style={{ margin: 5, padding: 10 }}>
......
import * as React from 'react';
import { Button, View, Text, TextInput, StyleSheet, Alert, Platform, Image, TouchableOpacity, StatusBar, ImageBackground, ScrollView } from 'react-native';
import Axios from 'axios';
import Constants from 'expo-constants';
import { connect } from 'react-redux';
import ActionType from '../redux/globalActionType';
import { BASE_URL_LOGIN } from '../model/Base_Model';
import { Notifications } from 'expo';
import Spinner from 'react-native-loading-spinner-overlay';
export default class WelcomeLog extends React.Component {
constructor(props) {
super(props);
this.state = ({
spinner: ''
})
}
componentDidMount() {
// console.log(this.props.language)
}
render() {
return (
<View style={styles.container}>
<Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
/>
<StatusBar
hidden={true} />
<ImageBackground source={require('../assets/images/after-log.jpg')} style={{ width: '100%', height: '100%' }}>
<View style={styles.v_form}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, justifyContent: 'center' }}>
</View>
<View style={{ flex: 1, height: 50, marginRight: 30, marginLeft: 30, justifyContent: 'center' }}>
</View>
<View style={{ flex: 1, height: 50, marginRight: 70, marginLeft: 70, justifyContent: 'center' }}>
</View>
</View>
<View style={styles.v_policy}>
<View style={{ flex: 1, height: 50, marginRight: 70, marginLeft: 70, justifyContent: 'center' }}>
<TouchableOpacity onPress={() => navigation.reset({
index: 0,
routes: [
{
name: 'Home',
params: { someParam: 'Param9' },
},
],
})}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'black', fontSize: 20, textAlign: 'center', margin: 15 }}>NEXT</Text>
</View>
</TouchableOpacity>
</View>
</View>
</ImageBackground>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#151515',
},
logo: {
flex: 2.5,
height: 50
},
imageslogo: {
height: 170,
margin: 10,
width: 150,
justifyContent: 'center',
alignSelf: 'center',
top: 50
},
v_form: {
flex: 3,
},
v_policy: {
flex: 2,
}
})
import * as React from 'react';
import { View, Text, TextInput, StyleSheet, Alert, Platform, Image, TouchableOpacity, StatusBar, ImageBackground } from 'react-native';
import Spinner from 'react-native-loading-spinner-overlay';
export default class Welcome extends React.Component {
constructor(props) {
super(props);
this.state = ({
spinner: ''
})
}
componentDidMount() {
// console.log(this.props.language)
}
render() {
return (
<View style={styles.container}>
<Spinner
visible={this.state.spinner}
textContent={'Loading...'}
textStyle={styles.spinnerTextStyle}
/>
<StatusBar
hidden={true} />
<ImageBackground source={require('../assets/images/after-log.jpg')} style={{ width: '100%', height: '100%' }}>
<View style={styles.v_form}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, justifyContent: 'center' }}>
</View>
<View style={{ flex: 1, height: 50, marginRight: 30, marginLeft: 30, justifyContent: 'center' }}>
</View>
<View style={{ flex: 1, height: 50, marginRight: 70, marginLeft: 70, justifyContent: 'center' }}>
</View>
</View>
<View style={styles.v_policy}>
<View style={{ flex: 1, height: 50, marginRight: 70, marginLeft: 70, justifyContent: 'center' }}>
<TouchableOpacity onPress={()=> this.props.navigation.navigate('Login')}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'black', fontSize: 20, textAlign: 'center', margin: 15 }}>NEXT</Text>
</View>
</TouchableOpacity>
</View>
</View>
</ImageBackground>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#151515',
},
logo: {
flex: 2.5,
height: 50
},
imageslogo: {
height: 170,
margin: 10,
width: 150,
justifyContent: 'center',
alignSelf: 'center',
top: 50
},
v_form: {
flex: 3,
},
v_policy: {
flex: 2,
}
})
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