Commit 71aa7f84 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

add edit profile page design

parent ad48184d
{ {
"expo": { "expo": {
"name": "Excelso_update 11.30 / 14.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
This diff is collapsed.
This diff is collapsed.
...@@ -51,6 +51,7 @@ import RewardSelect from './RewardSelect'; ...@@ -51,6 +51,7 @@ import RewardSelect from './RewardSelect';
import Outlets from './Outlets'; import Outlets from './Outlets';
import RewardHistory from './RewardHistory'; import RewardHistory from './RewardHistory';
import WelcomeReg from './WelcomeReg'; import WelcomeReg from './WelcomeReg';
import WelcomeLog from './WelcomeLog';
enableScreens(); enableScreens();
...@@ -113,9 +114,36 @@ class Auth extends React.Component { ...@@ -113,9 +114,36 @@ class Auth extends React.Component {
<> <>
<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="Change language" component={ChangeLanguage} /> */} {/* <Stack.Screen name="Change language" component={ChangeLanguage} /> */}
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} options={{ <Stack.Screen name="Email Confirmation" component={EmailConfirmation} options={{
...@@ -130,14 +158,18 @@ class Auth extends React.Component { ...@@ -130,14 +158,18 @@ class Auth extends React.Component {
textAlign: 'center' textAlign: 'center'
}, title: 'EMAIL CONFIRMATION' }, title: 'EMAIL CONFIRMATION'
}} /> }} />
<Stack.Screen name="Welcomes" component={WelcomeReg} options={{ <Stack.Screen name="Welcomes" component={WelcomeReg} options={{
headerShown: false , 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 }} />
</> </>
) : ( ) : (
...@@ -156,10 +188,33 @@ class Auth extends React.Component { ...@@ -156,10 +188,33 @@ class Auth extends React.Component {
} }
}} /> }} />
<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} />
...@@ -172,7 +227,18 @@ class Auth extends React.Component { ...@@ -172,7 +227,18 @@ 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", alignSelf: 'center' }, 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} />
......
This diff is collapsed.
...@@ -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',
}, },
], ],
}) })
......
...@@ -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)
}) })
} }
...@@ -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)
}) })
} }
......
...@@ -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,9 +181,7 @@ class Login extends React.Component { ...@@ -181,9 +181,7 @@ class Login extends React.Component {
} }
} }
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<Spinner <Spinner
...@@ -259,7 +257,7 @@ const styles = StyleSheet.create({ ...@@ -259,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',
......
This diff is collapsed.
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 * as React from 'react';
import { Button, View, Text, TextInput, StyleSheet, Alert, Platform, Image, TouchableOpacity, StatusBar, ImageBackground, ScrollView } from 'react-native'; import { View, Text, TextInput, StyleSheet, Alert, Platform, Image, TouchableOpacity, StatusBar, ImageBackground } 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'; import Spinner from 'react-native-loading-spinner-overlay';
export default class Welcome extends React.Component { export default class Welcome extends React.Component {
......
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