Commit aa61189d authored by Fred's avatar Fred

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

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
parents ff222ec7 4b565177
...@@ -17,7 +17,7 @@ class EmailConfirmation extends React.Component { ...@@ -17,7 +17,7 @@ class EmailConfirmation extends React.Component {
} }
} }
componentDidMount(){ componentDidMount() {
// console.log("SESSION " + this.props.session_id) // console.log("SESSION " + this.props.session_id)
} }
...@@ -28,13 +28,13 @@ class EmailConfirmation extends React.Component { ...@@ -28,13 +28,13 @@ class EmailConfirmation extends React.Component {
// console.log(this.props.isEmailverif) // console.log(this.props.isEmailverif)
if (this.props.isEmailverif === true) { if (this.props.isEmailverif === true) {
let pageProps = { let pageProps = {
pageEmailConfirmation:false pageEmailConfirmation: false
} }
this.props.setPage(pageProps) this.props.setPage(pageProps)
// console.log('hai ini gue kalau ada device yang sama!') // console.log('hai ini gue kalau ada device yang sama!')
let params = { let params = {
"session_id":this.props.session_id, "session_id": this.props.session_id,
"email": this.props.email, "email": this.props.email,
"password": this.props.password, "password": this.props.password,
"fb_token": this.props.fb_token, "fb_token": this.props.fb_token,
...@@ -47,7 +47,7 @@ class EmailConfirmation extends React.Component { ...@@ -47,7 +47,7 @@ class EmailConfirmation extends React.Component {
Axios.post(BASE_URL_LOGIN, params).then(res => { Axios.post(BASE_URL_LOGIN, params).then(res => {
// console.log('EMAIL CONFIRM : ' + JSON.stringify(res)) // console.log('EMAIL CONFIRM : ' + JSON.stringify(res))
let emailConfirmProps = { let emailConfirmProps = {
isEmailverif:false isEmailverif: false
} }
let loginProps = { let loginProps = {
email: this.props.email, email: this.props.email,
...@@ -81,7 +81,7 @@ class EmailConfirmation extends React.Component { ...@@ -81,7 +81,7 @@ class EmailConfirmation extends React.Component {
} else { } else {
let pageProps = { let pageProps = {
pageEmailConfirmation:false pageEmailConfirmation: false
} }
this.props.setPage(pageProps) this.props.setPage(pageProps)
let paramater = { let paramater = {
...@@ -92,6 +92,7 @@ class EmailConfirmation extends React.Component { ...@@ -92,6 +92,7 @@ class EmailConfirmation extends React.Component {
this.setState({ this.setState({
spinner: false, spinner: false,
}) })
console.log('masuk pak eko')
// this.props.navigation.reset("Login"); // this.props.navigation.reset("Login");
this.props.navigation.reset({ this.props.navigation.reset({
index: 0, index: 0,
...@@ -112,9 +113,9 @@ class EmailConfirmation extends React.Component { ...@@ -112,9 +113,9 @@ class EmailConfirmation extends React.Component {
} }
} }
handleCancel(){ handleCancel() {
let pageProps = { let pageProps = {
pageEmailConfirmation:false pageEmailConfirmation: false
} }
this.props.setPage(pageProps) this.props.setPage(pageProps)
this.props.navigation.navigate('New Register'); this.props.navigation.navigate('New Register');
...@@ -124,12 +125,40 @@ class EmailConfirmation extends React.Component { ...@@ -124,12 +125,40 @@ class EmailConfirmation extends React.Component {
this.setState({ this.setState({
spinner: true, spinner: true,
}) })
if (this.props.proses !== 'Register') {
let params = {
"email": this.props.email,
"password": this.props.password,
"fb_token": this.props.fb_token,
"device_id": this.props.device_id,
"os_name": this.props.os_name,
"os_version": this.props.os_version,
"app_version": this.props.app_version,
}
// console.log(params)
Axios.post(BASE_URL_LOGIN, params).then(res => {
this.setState({
spinner: false,
})
}).catch(error => {
let response = error.response.data;
Alert.alert('','Silahkan Cek Email Kembali');
this.setState({
spinner: false,
})
})
} else {
let paramater = { let paramater = {
"email": this.props.email, "email": this.props.email,
"registration_id": this.props.registration_id, "registration_id": this.props.registration_id,
} }
let pageProps = { let pageProps = {
pageEmailConfirmation:false pageEmailConfirmation: false
} }
this.props.setPage(pageProps) this.props.setPage(pageProps)
...@@ -149,10 +178,12 @@ class EmailConfirmation extends React.Component { ...@@ -149,10 +178,12 @@ class EmailConfirmation extends React.Component {
this.setState({ this.setState({
spinner: false, spinner: false,
}) })
Alert.alert(response.msg) Alert.alert('', response.msg)
}) })
} }
}
render() { render() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
...@@ -180,10 +211,10 @@ class EmailConfirmation extends React.Component { ...@@ -180,10 +211,10 @@ class EmailConfirmation extends React.Component {
<Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>CANCEL</Text> <Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>CANCEL</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={{ height: 60}} onPress={() => this.handleResend()}> <TouchableOpacity style={{ height: 60 }} onPress={() => this.handleResend()}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20 ,top:10}}>RESEND EMAIL TOKEN</Text> <Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20, top: 10 }}>RESEND EMAIL TOKEN</Text>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={{ height: 60}} onPress={() => this.props.navigation.navigate('Change Email')}> <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> <Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20, }}>CHANGE EMAIL</Text>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -262,18 +293,19 @@ const mapStateToProps = (state) => { ...@@ -262,18 +293,19 @@ const mapStateToProps = (state) => {
os_version: state.os_version, os_version: state.os_version,
os_name: state.os_name, os_name: state.os_name,
app_version: state.app_version, app_version: state.app_version,
page : state.page, page: state.page,
registration_id: state.registration_id, registration_id: state.registration_id,
pageEmailConfirmation: state.pageEmailConfirmation pageEmailConfirmation: state.pageEmailConfirmation,
proses: state.proses
} }
} }
const mapDispatchToProps = (dispacth) => { const mapDispatchToProps = (dispacth) => {
return { return {
setEmailConfirm:(emailConfirmProps) => dispacth({ setEmailConfirm: (emailConfirmProps) => dispacth({
type: ActionType.SET_EMAIL_VERIFICATION, type: ActionType.SET_EMAIL_VERIFICATION,
data:{ data: {
isEmailverif: emailConfirmProps.isEmailverif, isEmailverif: emailConfirmProps.isEmailverif,
} }
}), }),
...@@ -301,10 +333,10 @@ const mapDispatchToProps = (dispacth) => { ...@@ -301,10 +333,10 @@ const mapDispatchToProps = (dispacth) => {
} }
export default connect(mapStateToProps,mapDispatchToProps)(EmailConfirmation); export default connect(mapStateToProps, mapDispatchToProps)(EmailConfirmation);
{/* <Spinner {/* <Spinner
visible={this.state.spinner} visible={this.state.spinner}
textContent={'Loading...'} textContent={'Loading...'}
textStyle={styles.spinnerTextStyle} textStyle={styles.spinnerTextStyle}
......
...@@ -311,9 +311,7 @@ class OrderDetail extends React.Component { ...@@ -311,9 +311,7 @@ class OrderDetail extends React.Component {
{ {
this.state.detail_trans.grab_driver_name == '' ? ( this.state.detail_trans.grab_driver_name == '' ? (
<View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}> <View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'grey' }}>Name</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-SemiBoldItalic', color: 'grey' }}>Looking For Driver</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>Phone</Text>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>License Plate</Text>
</View> </View>
) : ( ) : (
<View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}> <View style={{ flex: 0.6, justifyContent: 'center', paddingLeft: 10 }}>
......
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