Commit e5ab7e7b authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo
parents 0ae635bc 6766c621
import React from 'react';
import { View, Text, TextInput, StyleSheet, Button, Alert, TouchableOpacity } from 'react-native';
import { View, Text, TextInput, StyleSheet, Button, ScrollView, Alert, TouchableOpacity } from 'react-native';
import { connect } from 'react-redux';
import Axios from 'axios';
import ActionType from '../redux/globalActionType';
......@@ -96,28 +96,37 @@ class CardActivation extends React.Component {
token: this.state.token
}
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/card/activate', params).then(res => {
Alert.alert("Kartu anda berhasil di aktifkan");
this.setState({
spinner: false,
})
Alert.alert(
"",
"Kartu anda berhasil di aktifkan",
[
{ text: "OK", onPress: () =>
{
this.setState({spinner: false})
this.props.navigation.reset({
index: 0,
routes: [{ name: 'Home' }],
})
}
}
],
);
}).catch(error => {
this.setState({
spinner: false,
})
let response = error.response.data;
Alert.alert('',response.msg);
Alert.alert(
'',
response.msg,
[
{ text: "OK", onPress: () => this.setState({spinner: false}) }
],
);
})
}
render() {
return (
<View style={styles.container}>
<ScrollView style={styles.container}>
<Spinner
visible={this.state.spinner}
textContent={'Loading...'}
......@@ -153,7 +162,7 @@ class CardActivation extends React.Component {
this.state.timer === 0 ? (
<TouchableOpacity onPress={() => this.ResendToken()}>
<View style={{ height: 40, borderRadius: 20, backgroundColor: '#CFB368', margin: 20, justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>Resend Token</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center' }}>Resend Token</Text>
</View>
</TouchableOpacity>
) : (null)}
......@@ -188,7 +197,7 @@ class CardActivation extends React.Component {
</TouchableOpacity>
</View>
</View>
</View>
</ScrollView>
)
}
}
......
......@@ -21,8 +21,14 @@ import {
} from 'react-native'
import MyStatusBar from './MyStatusBar';
const jobs = ["Pilih", "Siswa", "Mahasiswa", "Karyawan", "Pengusaha", "Lainnya"]
const jobs = ["Pilih", "Siswa", "Mahasiswa", "Karyawan", "Pengusaha", "Lainnya"];
const _jobs = [
{label: "Siswa", value: "Siswa"},
{label: "Mahasiswa", value: "Mahasiswa"},
{label: "Karyawan", value: "Karyawan"},
{label: "Pengusaha", value: "Pengusaha"},
{label: "Lainnya", value: "Lainnya"}
];
class UpgradePremium extends React.Component {
constructor(props) {
super(props)
......@@ -298,6 +304,13 @@ class UpgradePremium extends React.Component {
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368', textAlign: 'center' }}>Pekerjaan</Text>
</View>
<View style={{ marginHorizontal: 40, borderColor: 'gray', borderWidth: 1, borderRadius: 10, top: 10 }}>
{Platform.OS === 'ios' ? (
<RNPickerSelect onValueChange={(value) => this.setState({ pekerjaan: value })}
items={_jobs}
placeholder={{ label: '-- Select --' }}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}}
/>
) : (
<Picker
mode="dropdown"
selectedValue={this.state.pekerjaan}
......@@ -308,6 +321,8 @@ class UpgradePremium extends React.Component {
})}
</Picker>
)}
</View>
<View style={styles.textLabel, { top: 20 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368', textAlign: 'center' }}>KTP</Text>
......
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