Commit 6766c621 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 ed8222d5 ab72ace4
{ {
"welcome":"NEXT", "welcome":"NEXT",
"login":"LOGIN", "login":"LOGIN",
"Confirmpassword":"Confirm Password",
"Name":"Name",
"other":"Other",
"male":"Male",
"female":"Female",
"pilih":"Select",
"NotActivate":"You have not activated the card",
"NotorderHistory":"No Order History",
"gender":"Gender",
"dob":"Date of Birth",
"logout":"LOGOUT",
"email":"Email", "email":"Email",
"phone":"Phone",
"changepassword":"CHANGE PASSWORD",
"save":"Save",
"currentpassword":"Current Password",
"newpassword":"New Password",
"repeatpassword":"Repeat Password",
"language":"LANGUAGE",
"password":"Password", "password":"Password",
"register":"REGISTER", "register":"REGISTER",
"forgotPassword":"FORGOT PASSWORD", "forgotPassword":"FORGOT PASSWORD",
...@@ -10,11 +28,12 @@ ...@@ -10,11 +28,12 @@
"privacy":"our service guide rules and privacy policy", "privacy":"our service guide rules and privacy policy",
"rewardhistory":"REDEEM E-VOUCHER HISTORY", "rewardhistory":"REDEEM E-VOUCHER HISTORY",
"titlerewardhistory":"REWARDS E-VOUCHER", "titlerewardhistory":"REWARDS E-VOUCHER",
"orderhistory":"ORDER HISTORY",
"allcity":"All city", "allcity":"All city",
"name":"Name", "name":"Name",
"dob":"Date of Birth", "submit":"SUBMIT",
"gender":"Gender", "cancel":"CANCEL",
"submit":"Submit", "resendemail":"RENSEND EMAIL TOKEN",
"enterToken":"Enter Token", "enterToken":"Enter Token",
"delivery":"DELIVERY", "delivery":"DELIVERY",
"pickup":"PICKUP", "pickup":"PICKUP",
...@@ -29,5 +48,16 @@ ...@@ -29,5 +48,16 @@
"balance" : "BALANCE", "balance" : "BALANCE",
"point" : "POINTS :", "point" : "POINTS :",
"profile" : "Profile", "profile" : "Profile",
"View cart":"View Cart" "Viewcart":"View Cart",
"Viewprofil" :"View Profile",
"searchaddress":"Search Address",
"addaddress":"Add Address",
"label":"Label",
"selectaddress":"SELECT",
"detail":"Details",
"Transferbalance":"TRANSFER BALANCE",
"Transactionhistory":"TRANSFER HISTORY",
"Renewal":"RENEWAL",
"Usebalancepoint":"USE BALANCE / POINTS",
"Acitvatecard":"ACTIVATE CARD"
} }
\ No newline at end of file
{ {
"welcome": "LANJUT", "welcome": "LANJUT",
"login":"MASUK", "login":"MASUK",
"register":"DAFTAR",
"Confirmpassword":"Konfirmasi Password",
"Name":"Nama",
"NotorderHistory":"Tidak ada riwayat transaksi",
"NotActivate":"Anda belum aktivasi kartu",
"dob":"Tanggal Lahir",
"logout":"KELUAR",
"email":"Email", "email":"Email",
"phone":"Telephone",
"other":"Lain",
"male":"Pria",
"female":"Wanita",
"pilih":"pilih",
"gender":"Jenis Kelamin",
"password":"Kata Sandi", "password":"Kata Sandi",
"signin":"Masuk", "signin":"Masuk",
"register":"DAFTAR",
"forgotPassword":"LUPA KATA SANDI", "forgotPassword":"LUPA KATA SANDI",
"policy":"Dengan Login atau Register, Kamu menyetujui aturan", "policy":"Dengan Login atau Register, Kamu menyetujui aturan",
"privacy":"Panduan Layanan dan Kebijakan Privasi kami", "privacy":"Panduan Layanan dan Kebijakan Privasi kami",
"name":"Nama", "submit":"KIRIM",
"dob":"Tanggal Lahir", "cancel":"BATALKAN",
"gender":"Jenis Kelamin", "searchaddress":"Cari Alamat",
"submit":"Kirim", "addaddress":"Tambah Alamat",
"selectaddress":"PILIH",
"label":"Label",
"detail":"Details",
"resendemail":"KIRIM ULANG EMAIL TOKEN",
"enterToken":"Masukan Token", "enterToken":"Masukan Token",
"delivery":"ANTAR", "delivery":"ANTAR",
"pickup":"AMBIL", "pickup":"AMBIL",
"changepassword":"GANTI KATA SANDI",
"currentpassword":"Kata sandi lama",
"newpassword":"Kata sandi baru",
"repeatpassword":"Ulangi Kata sandi",
"save":"Simpan",
"language":"BAHASA",
"orderInfo" :"KAMU AKAN AMBIL PESANANMU DI", "orderInfo" :"KAMU AKAN AMBIL PESANANMU DI",
"orderNow" :"PESAN SEKARANG", "orderNow" :"PESAN SEKARANG",
"rewardhistory":"RIWAYAT HISTORY", "rewardhistory":"RIWAYAT REWARDS",
"orderhistory":"RIWAYAT ORDER",
"titlerewardhistory":"VOUCHER", "titlerewardhistory":"VOUCHER",
"allcity":"Semua kota", "allcity":"Semua kota",
"cardnumber" :"NOMOR KARTU", "cardnumber" :"NOMOR KARTU",
"expired": "Berakhir Pada", "expired": "Berakhir Pada",
"promotion":"PROMOSI HARI INI", "promotion":"PROMOSI HARI INI",
"deliveryinfo":"PESANAN MU AKAN DI ANTAR", "deliveryinfo":"DRIVER KAMI AKAN MENGIRIMKAN PESANAN ANDA KE",
"topup":" PENGISIAN SALDO ", "topup":" PENGISIAN SALDO ",
"usebalance": "GUNAKAN SALDO", "usebalance": "GUNAKAN SALDO",
"balance" :"SALDO", "balance" :"SALDO",
...@@ -31,8 +54,13 @@ ...@@ -31,8 +54,13 @@
"profile" :"Profil", "profile" :"Profil",
"upgradePremium" :"Tingkatkan Premium", "upgradePremium" :"Tingkatkan Premium",
"cardActivation" :"Aktivasi Kartu", "cardActivation" :"Aktivasi Kartu",
"View cart":"Lihat Keranjang" "Viewcart":"Keranjang",
"Viewprofil" :"Lihat Profil",
"Transferbalance":"TRANSFER SALDO",
"Transactionhistory":"RIWAYAT TRANSFER",
"Renewal":"RENEWAL",
"Usebalancepoint":"GUNAKAN SALDO / POINT",
"Acitvatecard":"AKTIVASI KARTU"
} }
......
...@@ -27,6 +27,7 @@ import * as Device from 'expo-device'; ...@@ -27,6 +27,7 @@ import * as Device from 'expo-device';
import session from '../function/session'; import session from '../function/session';
import Constants from 'expo-constants'; import Constants from 'expo-constants';
import Toast from 'react-native-tiny-toast'; import Toast from 'react-native-tiny-toast';
import i18n from 'i18n-js';
class Account extends React.Component { class Account extends React.Component {
constructor(props) { constructor(props) {
...@@ -204,7 +205,7 @@ class Account extends React.Component { ...@@ -204,7 +205,7 @@ class Account extends React.Component {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<ScrollView> <ScrollView>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')}>
<View style={{ flex: 1, height: 90 }}> <View style={{ flex: 1, height: 90 }}>
<View style={{ alignSelf: 'center' }}> <View style={{ alignSelf: 'center' }}>
<Image <Image
...@@ -217,11 +218,10 @@ class Account extends React.Component { ...@@ -217,11 +218,10 @@ class Account extends React.Component {
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center' }}> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center' }}>
{this.state.full_name} {this.state.full_name}
</Text> </Text>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')}> <Text style={{ fontFamily: 'Gotham-Light', color: '#838383', fontSize: 12, textAlign: 'center', top: 2 }}>{i18n.t('Viewprofil')}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: '#838383', fontSize: 12, textAlign: 'center', top: 2 }}>View Profile</Text>
</TouchableOpacity>
</View> </View>
</View> </View>
</TouchableOpacity>
{ {
this.props.set_card === false ? ( this.props.set_card === false ? (
...@@ -230,7 +230,7 @@ class Account extends React.Component { ...@@ -230,7 +230,7 @@ class Account extends React.Component {
<View style={{ justifyContent: 'center' }}> <View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation')}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, }}> <View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}>ACTIVATE CARD</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}> {i18n.t('Acitvatecard')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -239,7 +239,7 @@ class Account extends React.Component { ...@@ -239,7 +239,7 @@ class Account extends React.Component {
<View style={{ flex: 1, height: 250 }}> <View style={{ flex: 1, height: 250 }}>
<TouchableOpacity style={{ top: 10, marginLeft: 15, marginRight: 15, justifyContent: 'center' }} onPress={() => this.logout()}> <TouchableOpacity style={{ top: 10, marginLeft: 15, marginRight: 15, justifyContent: 'center' }} onPress={() => this.logout()}>
<View style={{ height: 40, borderRadius: 20, backgroundColor: '#CFB368', justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 20, backgroundColor: '#CFB368', justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>LOGOUT</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('logout')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<View style={styles.v_logo}> <View style={styles.v_logo}>
...@@ -266,10 +266,10 @@ class Account extends React.Component { ...@@ -266,10 +266,10 @@ class Account extends React.Component {
<Card style={{ padding: 20, alignContent: 'center' }}> <Card style={{ padding: 20, alignContent: 'center' }}>
<View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}> <View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}>
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>YOUR CARD NUMBER</Text> <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text>
</View> </View>
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>Expired At {this.state.expire_date}</Text> <Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>{i18n.t('expired')} {this.state.expire_date}</Text>
</View> </View>
</View> </View>
<View style={{ paddingHorizontal: 10 }}> <View style={{ paddingHorizontal: 10 }}>
...@@ -282,7 +282,7 @@ class Account extends React.Component { ...@@ -282,7 +282,7 @@ class Account extends React.Component {
<View style={{ flexDirection: 'row', flex: 1 }}> <View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}> <View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */} {/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>BALANCE</Text> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>{i18n.t('balance')}</Text>
</View> </View>
<View style={{ flex: 0.7, alignItems: 'center' }}> <View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text>
...@@ -293,7 +293,7 @@ class Account extends React.Component { ...@@ -293,7 +293,7 @@ class Account extends React.Component {
<View style={{ flexDirection: 'row', flex: 1 }}> <View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}> <View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */} {/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>POINTS</Text> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>{i18n.t('point')}</Text>
</View> </View>
<View style={{ flex: 0.7, alignItems: 'center' }}> <View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.points}</Text> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.points}</Text>
...@@ -306,7 +306,7 @@ class Account extends React.Component { ...@@ -306,7 +306,7 @@ class Account extends React.Component {
</View> </View>
</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={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>TOP UP BALANCE</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('topup')}</Text>
</TouchableOpacity> </TouchableOpacity>
<View style={{ padding: 10, height: 200, top: 10, margin: 10 }}> <View style={{ padding: 10, height: 200, top: 10, margin: 10 }}>
<ImageBackground 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}>
...@@ -326,7 +326,7 @@ class Account extends React.Component { ...@@ -326,7 +326,7 @@ class Account extends React.Component {
style={{ height: 50, width: 50, justifyContent: 'center' }} style={{ height: 50, width: 50, justifyContent: 'center' }}
source={require('../assets/icon/4.png')} source={require('../assets/icon/4.png')}
/> />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 5, fontSize: 14, color: '#838383' }}>TRANSFER BALANCE</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 5, fontSize: 14, color: '#838383' }}> {i18n.t('Transferbalance')}</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
...@@ -338,7 +338,7 @@ class Account extends React.Component { ...@@ -338,7 +338,7 @@ class Account extends React.Component {
style={{ height: 50, width: 50, justifyContent: 'center' }} style={{ height: 50, width: 50, justifyContent: 'center' }}
source={require('../assets/icon/2.png')} source={require('../assets/icon/2.png')}
/> />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 5, fontSize: 14, color: '#838383' }}>USE BALANCE / POINT</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 5, fontSize: 14, color: '#838383' }}> {i18n.t('Usebalancepoint')}</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
...@@ -352,7 +352,7 @@ class Account extends React.Component { ...@@ -352,7 +352,7 @@ class Account extends React.Component {
style={{ height: 50, width: 50, justifyContent: 'center' }} style={{ height: 50, width: 50, justifyContent: 'center' }}
source={require('../assets/icon/1.png')} source={require('../assets/icon/1.png')}
/> />
<Text style={{ fontFamily: 'Gotham-Black', flexDirection: 'row', textAlign: 'center', flexWrap: 'wrap', margin: 5, color: '#838383' }}>TRANSACTION HISTORY</Text> <Text style={{ fontFamily: 'Gotham-Black', flexDirection: 'row', textAlign: 'center', flexWrap: 'wrap', margin: 5, color: '#838383' }}> {i18n.t('Transactionhistory')}</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
...@@ -365,7 +365,7 @@ class Account extends React.Component { ...@@ -365,7 +365,7 @@ class Account extends React.Component {
style={{ height: 50, width: 50, justifyContent: 'center' }} style={{ height: 50, width: 50, justifyContent: 'center' }}
source={require('../assets/icon/3.png')} source={require('../assets/icon/3.png')}
/> />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 5, fontSize: 14, margin: 5, color: '#838383' }}>RENEWAL</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', top: 5, fontSize: 14, margin: 5, color: '#838383' }}> {i18n.t('Renewal')}</Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
...@@ -377,7 +377,7 @@ class Account extends React.Component { ...@@ -377,7 +377,7 @@ class Account extends React.Component {
<Card style={{ width: 200, paddingHorizontal: 10, paddingTop: 20, paddingBottom: 20 }}> <Card style={{ width: 200, paddingHorizontal: 10, paddingTop: 20, paddingBottom: 20 }}>
<View style={{ flex: 1, alignItems: 'center' }}> <View style={{ flex: 1, alignItems: 'center' }}>
<MaterialIcons name="autorenew" size={30} color="gray" style={{ marginBottom: 10 }} /> <MaterialIcons name="autorenew" size={30} color="gray" style={{ marginBottom: 10 }} />
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', fontSize: 14, color: '#838383' }}>UPGRADE PREMIUM</Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', fontSize: 14, color: '#838383' }}></Text>
</View> </View>
</Card> </Card>
</TouchableOpacity> </TouchableOpacity>
...@@ -390,7 +390,7 @@ class Account extends React.Component { ...@@ -390,7 +390,7 @@ class Account extends React.Component {
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<TouchableOpacity onPress={() => this.logout()}> <TouchableOpacity onPress={() => this.logout()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginLeft: 20, marginRight: 20, marginBottom: 20, padding: 5, bottom: 5, top: 1 }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginLeft: 20, marginRight: 20, marginBottom: 20, padding: 5, bottom: 5, top: 1 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>LOGOUT</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('logout')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
...@@ -523,7 +523,8 @@ const mapStateToProps = (state) => { ...@@ -523,7 +523,8 @@ const mapStateToProps = (state) => {
return { return {
session_id: state.session_id, session_id: state.session_id,
set_card: state.set_card, set_card: state.set_card,
in_payment: state.in_payment in_payment: state.in_payment,
language: state.language,
} }
} }
......
...@@ -10,6 +10,7 @@ import Axios from 'axios'; ...@@ -10,6 +10,7 @@ import Axios from 'axios';
import Spinner from 'react-native-loading-spinner-overlay'; import Spinner from 'react-native-loading-spinner-overlay';
import { MaterialCommunityIcons, Ionicons } from '@expo/vector-icons'; import { MaterialCommunityIcons, Ionicons } from '@expo/vector-icons';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import i18n from 'i18n-js';
class AddreesDetail extends React.Component { class AddreesDetail extends React.Component {
...@@ -227,13 +228,13 @@ class AddreesDetail extends React.Component { ...@@ -227,13 +228,13 @@ class AddreesDetail extends React.Component {
</View> </View>
</View> </View>
<View style={styles.field_name_addrees}> <View style={styles.field_name_addrees}>
<Text style={{ fontFamily: 'Gotham-Black', color: "#ccb46c", textAlign: 'center', fontSize: 18 }}>Label</Text> <Text style={{ fontFamily: 'Gotham-Black', color: "#ccb46c", textAlign: 'center', fontSize: 18 }}>{i18n.t('label')}</Text>
<TextInput style={{ height: 40, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }} onChangeText={(name) => this.setState({ name })} /> <TextInput style={{ height: 40, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }} onChangeText={(name) => this.setState({ name })} />
</View> </View>
<View style={styles.field_detail_addrees}> <View style={styles.field_detail_addrees}>
<Text style={{ fontFamily: 'Gotham-Black', color: "#ccb46c",textAlign:'center', fontSize: 18 }}>Detail</Text> <Text style={{ fontFamily: 'Gotham-Black', color: "#ccb46c",textAlign:'center', fontSize: 18 }}>{i18n.t('detail')}</Text>
<TextInput <TextInput
style={{ height: 150, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }} style={{ height: 150, borderWidth: 1, padding: 5, flex: 1, margin: 10, borderRadius: 10, borderColor: 'grey' }}
onChangeText={(description) => this.setState({ description })} onChangeText={(description) => this.setState({ description })}
...@@ -243,7 +244,7 @@ class AddreesDetail extends React.Component { ...@@ -243,7 +244,7 @@ class AddreesDetail extends React.Component {
<View style={{ margin: 50, justifyContent: 'center' }}> <View style={{ margin: 50, justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.saveAddress()}> <TouchableOpacity onPress={() => this.saveAddress()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}> Tambah Alamat</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('addaddress')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -315,6 +316,7 @@ const mapStateToProps = (state) => { ...@@ -315,6 +316,7 @@ const mapStateToProps = (state) => {
return { return {
session_id: state.session_id, session_id: state.session_id,
language: state.language,
} }
} }
......
...@@ -42,7 +42,6 @@ class Language extends React.Component { ...@@ -42,7 +42,6 @@ class Language extends React.Component {
<View style={{ flex: 0.2 }} /> <View style={{ flex: 0.2 }} />
<View style={styles.body}> <View style={styles.body}>
{ {
this.props.language == 'en' ? ( this.props.language == 'en' ? (
<> <>
...@@ -127,7 +126,7 @@ class Language extends React.Component { ...@@ -127,7 +126,7 @@ class Language extends React.Component {
<TouchableOpacity onPress={() => this.props.navigation.goBack()}> <TouchableOpacity onPress={() => this.props.navigation.goBack()}>
<View style={styles.button}> <View style={styles.button}>
<Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>Save</Text> <Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>{i18n.t('save')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
......
...@@ -4,6 +4,7 @@ import Axios from 'axios'; ...@@ -4,6 +4,7 @@ import Axios from 'axios';
import { BASE_URL_CHANGE_PASSWORD } from '../model/Base_Model'; import { BASE_URL_CHANGE_PASSWORD } from '../model/Base_Model';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import MyStatusBar from './MyStatusBar'; import MyStatusBar from './MyStatusBar';
import i18n from 'i18n-js';
class ChangePassword extends React.Component { class ChangePassword extends React.Component {
constructor(props) { constructor(props) {
...@@ -47,7 +48,7 @@ class ChangePassword extends React.Component { ...@@ -47,7 +48,7 @@ class ChangePassword extends React.Component {
<View style={styles.field_token}> <View style={styles.field_token}>
<View style={{ marginBottom: 25 }}> <View style={{ marginBottom: 25 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368', textAlign: 'center' }}>Current Password</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368', textAlign: 'center' }}>{i18n.t('currentpassword')}</Text>
</View> </View>
<View style={styles.items2}> <View style={styles.items2}>
<TextInput style={styles.textInput} <TextInput style={styles.textInput}
...@@ -59,7 +60,7 @@ class ChangePassword extends React.Component { ...@@ -59,7 +60,7 @@ class ChangePassword extends React.Component {
</View> </View>
<View style={styles.field_token}> <View style={styles.field_token}>
<View style={{ marginBottom: 25 }}> <View style={{ marginBottom: 25 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368', textAlign: 'center' }}>New Password</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368', textAlign: 'center' }}>{i18n.t('newpassword')}</Text>
</View> </View>
<View style={styles.items2}> <View style={styles.items2}>
<TextInput style={styles.textInput} <TextInput style={styles.textInput}
...@@ -71,7 +72,7 @@ class ChangePassword extends React.Component { ...@@ -71,7 +72,7 @@ class ChangePassword extends React.Component {
</View> </View>
<View style={styles.field_token}> <View style={styles.field_token}>
<View style={{ marginBottom: 25 }}> <View style={{ marginBottom: 25 }}>
<Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368', textAlign: 'center' }}>Repeat Password</Text> <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368', textAlign: 'center' }}>{i18n.t('repeatpassword')}</Text>
</View> </View>
<View style={styles.items2}> <View style={styles.items2}>
<TextInput style={styles.textInput} <TextInput style={styles.textInput}
...@@ -87,7 +88,7 @@ class ChangePassword extends React.Component { ...@@ -87,7 +88,7 @@ class ChangePassword extends React.Component {
<TouchableOpacity onPress={() => this.changePassword()}> <TouchableOpacity onPress={() => this.changePassword()}>
<View style={styles.button}> <View style={styles.button}>
<Text style={{ color: 'white', fontSize: 12, fontFamily: 'Gotham-Black' }}>Change Password</Text> <Text style={{ color: 'white', fontSize: 16, fontFamily: 'Gotham-Black' }}>{i18n.t('changepassword')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
...@@ -146,8 +147,9 @@ const styles = StyleSheet.create({ ...@@ -146,8 +147,9 @@ const styles = StyleSheet.create({
backgroundColor: '#CFB368', backgroundColor: '#CFB368',
marginTop: 50, marginTop: 50,
marginHorizontal: 100, marginHorizontal: 100,
borderRadius: 15, borderRadius: 10,
padding:10, padding:10,
height:40,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center' justifyContent: 'center'
}, },
...@@ -157,6 +159,7 @@ const styles = StyleSheet.create({ ...@@ -157,6 +159,7 @@ const styles = StyleSheet.create({
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
return { return {
session_id: state.session_id, session_id: state.session_id,
language: state.language
} }
} }
......
...@@ -7,6 +7,7 @@ import Axios from 'axios'; ...@@ -7,6 +7,7 @@ import Axios from 'axios';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import { MaterialCommunityIcons, Ionicons } from '@expo/vector-icons'; import { MaterialCommunityIcons, Ionicons } from '@expo/vector-icons';
import MyStatusBar from './MyStatusBar'; import MyStatusBar from './MyStatusBar';
import i18n from 'i18n-js';
// import ravLog from '../helper/debug'; // import ravLog from '../helper/debug';
...@@ -197,9 +198,6 @@ class DeliveryAddrees extends React.Component { ...@@ -197,9 +198,6 @@ class DeliveryAddrees extends React.Component {
}) })
// let recalculateProps = { // let recalculateProps = {
// order_total: 0, // order_total: 0,
// order_quantity:0, // order_quantity:0,
...@@ -237,7 +235,7 @@ class DeliveryAddrees extends React.Component { ...@@ -237,7 +235,7 @@ class DeliveryAddrees extends React.Component {
/> />
</View> </View>
<View> <View>
<Text style={{ textAlign: 'center', color: '#ccb46c', fontFamily: 'Gotham-Light', marginRight: 20 }}>PILIH</Text> <Text style={{ textAlign: 'center', color: '#ccb46c', fontFamily: 'Gotham-Light', marginRight: 20 }}>{i18n.t('selectaddress')}</Text>
</View> </View>
</View> </View>
...@@ -266,7 +264,7 @@ class DeliveryAddrees extends React.Component { ...@@ -266,7 +264,7 @@ class DeliveryAddrees extends React.Component {
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" /> <MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View> </View>
<View style={{ flex: 6 }}> <View style={{ flex: 6 }}>
<TextInput style={{ height: 45 }} placeholder="Cari Alamat" <TextInput style={{ height: 45 }} placeholder={i18n.t('searchaddress')}
onChangeText={text => this.filterData(text)} onChangeText={text => this.filterData(text)}
onClear={text => this.filterData('')} onClear={text => this.filterData('')}
value={this.state.search}></TextInput> value={this.state.search}></TextInput>
...@@ -278,7 +276,7 @@ class DeliveryAddrees extends React.Component { ...@@ -278,7 +276,7 @@ class DeliveryAddrees extends React.Component {
<View style={styles.btn_addreess}> <View style={styles.btn_addreess}>
<TouchableOpacity onPress={() => this.addAdreess()}> <TouchableOpacity onPress={() => this.addAdreess()}>
<View style={{ height: 40, borderRadius: 10, marginRight: 70, marginLeft: 70, backgroundColor: '#CFB368', justifyContent: 'center', alignContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, marginRight: 70, marginLeft: 70, backgroundColor: '#CFB368', justifyContent: 'center', alignContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', color: 'white', fontSize: 16 }}> Tambah Alamat </Text> <Text style={{ fontFamily: 'Gotham-Black', textAlign: 'center', color: 'white', fontSize: 16 }}> {i18n.t('addaddress')} </Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
...@@ -344,7 +342,8 @@ const mapStateToProps = (state) => { ...@@ -344,7 +342,8 @@ const mapStateToProps = (state) => {
return { return {
session_id: state.session_id, session_id: state.session_id,
addressId: state.addressId addressId: state.addressId,
language: state.language
} }
} }
......
...@@ -7,6 +7,7 @@ import ActionType from '../redux/globalActionType'; ...@@ -7,6 +7,7 @@ import ActionType from '../redux/globalActionType';
import { BASE_URL_LOGIN } from '../model/Base_Model'; import { BASE_URL_LOGIN } from '../model/Base_Model';
import Spinner from 'react-native-loading-spinner-overlay'; import Spinner from 'react-native-loading-spinner-overlay';
import MyStatusBar from './MyStatusBar'; import MyStatusBar from './MyStatusBar';
import i18n from 'i18n-js';
class EmailConfirmation extends React.Component { class EmailConfirmation extends React.Component {
...@@ -212,19 +213,19 @@ class EmailConfirmation extends React.Component { ...@@ -212,19 +213,19 @@ class EmailConfirmation extends React.Component {
value={this.state.confirmation_number} value={this.state.confirmation_number}
autoCapitalize="none" autoCapitalize="none"
value={this.state.email} value={this.state.email}
keyboardType='email-address' /> keyboardType='numeric' />
<TouchableOpacity style={{ height: 100 }} onPress={() => this.handleSubmit()}> <TouchableOpacity style={{ height: 100 }} onPress={() => this.handleSubmit()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 10, borderRadius: 10, marginRight: 50, marginLeft: 50 }}> <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> <Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>{i18n.t('submit')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity style={{ height: 100 }} onPress={() => this.handleCancel()}> <TouchableOpacity style={{ height: 100 }} onPress={() => this.handleCancel()}>
<View style={{ backgroundColor: '#CFB368', height: 45, top: 10, borderRadius: 10, marginRight: 50, marginLeft: 50 }}> <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> <Text style={{ alignSelf: 'center', top: 10, color: 'white', fontFamily: 'Gotham-Black', fontSize: 20 }}>{i18n.t('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 }}>{i18n.t('resendemail')}</Text>
</TouchableOpacity> </TouchableOpacity>
{this.props.proses == 'Register' ? ( {this.props.proses == 'Register' ? (
<TouchableOpacity style={{ height: 60 }} onPress={() => this.props.navigation.navigate('Change Email')}> <TouchableOpacity style={{ height: 60 }} onPress={() => this.props.navigation.navigate('Change Email')}>
...@@ -310,7 +311,8 @@ const mapStateToProps = (state) => { ...@@ -310,7 +311,8 @@ const mapStateToProps = (state) => {
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 proses: state.proses,
language: state.language
} }
} }
......
...@@ -41,7 +41,7 @@ class Home extends React.Component { ...@@ -41,7 +41,7 @@ class Home extends React.Component {
componentDidMount() { componentDidMount() {
// const { navigation } = this.props // const { navigation } = this.props
// CheckVersion(navigation) // CheckVersion(navigation)
const screenWidth = Math.round(Dimensions.get('window').width); const screenWidth = Math.round(Dimensions.get('window').width);
this.setState({ this.setState({
slider_height: screenWidth slider_height: screenWidth
...@@ -66,7 +66,7 @@ class Home extends React.Component { ...@@ -66,7 +66,7 @@ class Home extends React.Component {
this._account(); this._account();
if (this.props.outlet_id == '' && this.props.name_outlet == '' && this.props.outlet_detailadress == '') { if (this.props.outlet_id == '' && this.props.name_outlet == '' && this.props.outlet_detailadress == '') {
this._getPermissions() this._getPermissions()
} else { } else {
this.setState({ this.setState({
indicator: false, indicator: false,
...@@ -316,8 +316,8 @@ class Home extends React.Component { ...@@ -316,8 +316,8 @@ class Home extends React.Component {
{i18n.t('orderInfo')} {i18n.t('orderInfo')}
</Text> */} </Text> */}
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#838383' }}> <Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#838383' }}>
{i18n.t('orderInfo')} {i18n.t('orderInfo')}
</Text> </Text>
{this.state.indicator == true ? ( {this.state.indicator == true ? (
<ActivityIndicator size="small" color="#c9af6d" /> <ActivityIndicator size="small" color="#c9af6d" />
) : ( ) : (
...@@ -352,7 +352,7 @@ class Home extends React.Component { ...@@ -352,7 +352,7 @@ class Home extends React.Component {
{i18n.t('orderInfo')} {i18n.t('orderInfo')}
</Text> */} </Text> */}
<Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#838383' }}> <Text style={{ textAlign: 'center', fontSize: 12, fontFamily: 'Gotham-Black', color: '#838383' }}>
OUR DRIVER WILL DELIVER YOUR ORDER TO {i18n.t('orderInfo')}
</Text> </Text>
{this.state.indicator == true ? ( {this.state.indicator == true ? (
<ActivityIndicator size="small" color="#c9af6d" /> <ActivityIndicator size="small" color="#c9af6d" />
...@@ -365,7 +365,7 @@ class Home extends React.Component { ...@@ -365,7 +365,7 @@ class Home extends React.Component {
<Text style={{ textAlign: 'center', bottom: 5, color: 'white' }}>{i18n.t('orderNow')}</Text> <Text style={{ textAlign: 'center', bottom: 5, color: 'white' }}>{i18n.t('orderNow')}</Text>
</TouchableOpacity> */} </TouchableOpacity> */}
<TouchableOpacity style={styles.submitOrder} activeOpacity={.5} onPress={() => this._orderNow()}> <TouchableOpacity style={styles.submitOrder} activeOpacity={.5} onPress={() => this._orderNow()}>
<Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 16 }}>ORDER NOW</Text> <Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 16 }}>{i18n.t('orderNow')}</Text>
</TouchableOpacity> </TouchableOpacity>
</Card> </Card>
) )
...@@ -385,20 +385,17 @@ class Home extends React.Component { ...@@ -385,20 +385,17 @@ class Home extends React.Component {
) : ) :
this.state.account_number === "" ? ( this.state.account_number === "" ? (
<View style={styles.card}> <View style={styles.card}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center', backgroundColor: '#838383' }}>
<Text style={{ textAlign: "center", fontFamily: 'Gotham-Light' }}> Anda belum aktivasi kartu</Text> <View style={{ flex: 1, backgroundColor: 'grey', height: 150, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<Text> <View style={{ justifyContent: 'center' }}>
</Text> <TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation')}>
<Text style={{ textAlign: "center", fontSize: 40, color: '#c9af6d' }}> <View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}> {i18n.t('Acitvatecard')}</Text>
</Text> </View>
<View style={styles.line}></View> </TouchableOpacity>
<Text style={{ textAlign: 'left', fontWeight: 'bold' }}> {'\n'} </View>
</Text> </View>
<View style={styles.line}></View>
<Text style={{ textAlign: 'left', fontWeight: 'bold' }}>{'\n'}
</Text>
</Card> </Card>
</View> </View>
) : ) :
...@@ -672,7 +669,7 @@ const mapStateToProps = (state) => { ...@@ -672,7 +669,7 @@ const mapStateToProps = (state) => {
// login // login
in_payment: state.in_payment, in_payment: state.in_payment,
BASE_URL : state.BASE_URL, BASE_URL: state.BASE_URL,
email: state.email, email: state.email,
outlet_id: state.outlet_id, outlet_id: state.outlet_id,
name_outlet: state.name_outlet, name_outlet: state.name_outlet,
......
...@@ -11,6 +11,7 @@ import * as Location from 'expo-location'; ...@@ -11,6 +11,7 @@ import * as Location from 'expo-location';
import * as Permissions from 'expo-permissions'; import * as Permissions from 'expo-permissions';
import * as Device from 'expo-device'; import * as Device from 'expo-device';
import NumberFormat from 'react-number-format'; import NumberFormat from 'react-number-format';
import i18n from 'i18n-js';
class MenuSelection extends React.Component { class MenuSelection extends React.Component {
constructor(props) { constructor(props) {
...@@ -342,7 +343,7 @@ class MenuSelection extends React.Component { ...@@ -342,7 +343,7 @@ class MenuSelection extends React.Component {
<View> <View>
<View style={{ height: 40, borderRadius: 10, width: '68%', backgroundColor: '#CFB368', marginRight: 20, marginLeft: 40, top: 15, flexDirection: 'row', marginBottom: 30 }}> <View style={{ height: 40, borderRadius: 10, width: '68%', backgroundColor: '#CFB368', marginRight: 20, marginLeft: 40, top: 15, flexDirection: 'row', marginBottom: 30 }}>
<Image source={(require('../assets/icon/icon-order.png'))} style={{ height: 40, width: 40, tintColor: 'white', }}></Image> <Image source={(require('../assets/icon/icon-order.png'))} style={{ height: 40, width: 40, tintColor: 'white', }}></Image>
<Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 16, alignSelf: 'center', textAlign: 'center' }}>View Cart</Text> <Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 16, alignSelf: 'center', textAlign: 'center' }}>{i18n.t('Viewcart')}</Text>
</View> </View>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
...@@ -389,7 +390,8 @@ const mapStateToProps = (state) => { ...@@ -389,7 +390,8 @@ const mapStateToProps = (state) => {
order_total: state.order_total, order_total: state.order_total,
quantity: state.quantity, quantity: state.quantity,
address: state.address, address: state.address,
menu_item: state.menu_item menu_item: state.menu_item,
language: state.language
} }
} }
......
...@@ -59,19 +59,19 @@ class NewRegister extends React.Component { ...@@ -59,19 +59,19 @@ class NewRegister extends React.Component {
let date_list = [] let date_list = []
for (let i = 1; i <= 31; i++) { for (let i = 1; i <= 31; i++) {
date_list.push({label: String(i), value: i}); date_list.push({ label: String(i), value: i });
} }
let month_list = [] let month_list = []
for (let i = 1; i <= 12; i++) { for (let i = 1; i <= 12; i++) {
const month_name = month[i]; const month_name = month[i];
month_list.push({label: month_name, value: i}); month_list.push({ label: month_name, value: i });
} }
let year_list = [] let year_list = []
let current_year = new Date().getFullYear(); let current_year = new Date().getFullYear();
let start_year = current_year - 65; let start_year = current_year - 65;
let end_year = current_year - 13; let end_year = current_year - 13;
for (let i = start_year; i <= end_year; i++) { for (let i = start_year; i <= end_year; i++) {
year_list.push({label: String(i), value: i}); year_list.push({ label: String(i), value: i });
} }
this.setState({ this.setState({
date: date_list, date: date_list,
...@@ -91,7 +91,7 @@ class NewRegister extends React.Component { ...@@ -91,7 +91,7 @@ class NewRegister extends React.Component {
for (const key in list_gender) { for (const key in list_gender) {
if (list_gender.hasOwnProperty(key)) { if (list_gender.hasOwnProperty(key)) {
const row = list_gender[key]; const row = list_gender[key];
gender_list.push({label: row, value: key}) gender_list.push({ label: row, value: key })
} }
} }
this.setState({ this.setState({
...@@ -245,16 +245,18 @@ class NewRegister extends React.Component { ...@@ -245,16 +245,18 @@ class NewRegister extends React.Component {
this.props.navigation.navigate('Email Confirmation') this.props.navigation.navigate('Email Confirmation')
}).catch(error => { }).catch(error => {
this.setState({
spinner: false,
})
// console.log(JSON.stringify(error.response)); // console.log(JSON.stringify(error.response));
let response = error.response.data; let response = error.response.data;
Alert.alert( Alert.alert(
'', '',
response.msg, response.msg,
[ [
{ text: 'OK' } {
text: 'OK', onPress: () => this.setState({
spinner: false,
})
}
] ]
) )
}) })
...@@ -274,7 +276,7 @@ class NewRegister extends React.Component { ...@@ -274,7 +276,7 @@ class NewRegister extends React.Component {
<View style={styles.itemsRow}> <View style={styles.itemsRow}>
<View style={styles.items1}> <View style={styles.items1}>
<Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}>Email</Text> <Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}>{i18n.t('email')}</Text>
</View> </View>
<View style={styles.items2}> <View style={styles.items2}>
<TextInput <TextInput
...@@ -293,7 +295,7 @@ class NewRegister extends React.Component { ...@@ -293,7 +295,7 @@ class NewRegister extends React.Component {
<View style={styles.itemsRow}> <View style={styles.itemsRow}>
<View style={styles.items1}> <View style={styles.items1}>
{/* <Text>{i18n.t('password')}</Text> */} {/* <Text>{i18n.t('password')}</Text> */}
<Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}>Password</Text> <Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}>{i18n.t('password')}</Text>
</View> </View>
<View style={styles.items2}> <View style={styles.items2}>
<TextInput <TextInput
...@@ -310,7 +312,7 @@ class NewRegister extends React.Component { ...@@ -310,7 +312,7 @@ class NewRegister extends React.Component {
<View style={styles.itemsRow}> <View style={styles.itemsRow}>
<View style={styles.items1}> <View style={styles.items1}>
{/* <Text>{i18n.t('password2')}</Text> */} {/* <Text>{i18n.t('password2')}</Text> */}
<Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}>Confirm Password</Text> <Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}> {i18n.t('Confirmpassword')}</Text>
</View> </View>
<View style={styles.items2}> <View style={styles.items2}>
<TextInput <TextInput
...@@ -327,7 +329,7 @@ class NewRegister extends React.Component { ...@@ -327,7 +329,7 @@ class NewRegister extends React.Component {
<View style={styles.itemsRow}> <View style={styles.itemsRow}>
<View style={styles.items1}> <View style={styles.items1}>
{/* <Text>{i18n.t('name')}</Text> */} {/* <Text>{i18n.t('name')}</Text> */}
<Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}>Name</Text> <Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}>{i18n.t('Name')}</Text>
</View> </View>
<View style={styles.items2}> <View style={styles.items2}>
<TextInput <TextInput
...@@ -342,75 +344,75 @@ class NewRegister extends React.Component { ...@@ -342,75 +344,75 @@ class NewRegister extends React.Component {
</View> </View>
<View style={styles.itemsRow}> <View style={styles.itemsRow}>
<View style={styles.items1}> <View style={styles.items1}>
<Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}>Date Of Birth</Text> <Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}>{i18n.t('dob')}</Text>
</View> </View>
{Platform.OS === 'ios' ? ( {Platform.OS === 'ios' ? (
<View style={styles.itemPicker}> <View style={styles.itemPicker}>
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center', marginLeft: 10 }}> <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center', marginLeft: 10 }}>
<RNPickerSelect onValueChange={(value) => this.setState({ dob_day: value })} <RNPickerSelect onValueChange={(value) => this.setState({ dob_day: value })}
items={this.state.date} items={this.state.date}
placeholder={{ label: '-- Select --' }} placeholder={{ label: '-- Select --' }}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}} style={{ inputIOSContainer: { paddingVertical: 10, alignItems: 'center' } }}
/> />
</View> </View>
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<RNPickerSelect onValueChange={(value) => this.setState({ dob_month: value })} <RNPickerSelect onValueChange={(value) => this.setState({ dob_month: value })}
items={this.state.month} items={this.state.month}
placeholder={{ label: '-- Select --' }} placeholder={{ label: '-- Select --' }}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}} style={{ inputIOSContainer: { paddingVertical: 10, alignItems: 'center' } }}
/> />
</View> </View>
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center', marginRight: 10 }}> <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center', marginRight: 10 }}>
<RNPickerSelect onValueChange={(value) => this.setState({ dob_year: value })} <RNPickerSelect onValueChange={(value) => this.setState({ dob_year: value })}
items={this.state.year} items={this.state.year}
placeholder={{ label: '-- Select --' }} placeholder={{ label: '-- Select --' }}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}} style={{ inputIOSContainer: { paddingVertical: 10, alignItems: 'center' } }}
/> />
</View> </View>
</View> </View>
) : ( ) : (
<View style={styles.itemPicker}> <View style={styles.itemPicker}>
<View style={{ height: 35, flex: 1, alignItems: 'center' }}> <View style={{ height: 35, flex: 1, alignItems: 'center' }}>
<Picker <Picker
mode="dropdown" mode="dropdown"
selectedValue={this.state.dob_day} selectedValue={this.state.dob_day}
style={{ height: 35, width: 100 }} style={{ height: 35, width: 100 }}
onValueChange={(itemValue, itemIndex) => this.setState({ dob_day: itemValue })}> onValueChange={(itemValue, itemIndex) => this.setState({ dob_day: itemValue })}>
{date.map((itemValue, itemIndex) => { {date.map((itemValue, itemIndex) => {
return (<Picker.Item label={itemValue} value={itemValue} key={itemIndex} />) return (<Picker.Item label={itemValue} value={itemValue} key={itemIndex} />)
})} })}
</Picker> </Picker>
</View> </View>
<View style={{ height: 35, flex: 1, alignItems: 'center' }}> <View style={{ height: 35, flex: 1, alignItems: 'center' }}>
<Picker <Picker
mode="dropdown" mode="dropdown"
selectedValue={this.state.dob_month} selectedValue={this.state.dob_month}
style={{ height: 35, width: 100 }} style={{ height: 35, width: 100 }}
onValueChange={(itemValue, itemIndex) => onValueChange={(itemValue, itemIndex) =>
this.setState({ dob_month: itemValue }) this.setState({ dob_month: itemValue })
}> }>
{month.map((itemValue, itemIndex) => { {month.map((itemValue, itemIndex) => {
return (<Picker.Item label={itemValue} value={itemIndex} key={itemIndex} />) return (<Picker.Item label={itemValue} value={itemIndex} key={itemIndex} />)
})} })}
</Picker> </Picker>
</View>
<View style={{ height: 35, flex: 1, alignItems: 'center' }}>
<Picker
mode="dropdown"
selectedValue={this.state.dob_year}
style={{ height: 35, width: 100 }}
onValueChange={(itemValue, itemIndex) =>
this.setState({ dob_year: itemValue })
}>
{year.map((itemValue, itemIndex) => {
return (<Picker.Item label={itemValue} value={itemValue} key={itemIndex} />)
})}
</Picker>
</View>
</View> </View>
<View style={{ height: 35, flex: 1, alignItems: 'center' }}>
<Picker
mode="dropdown"
selectedValue={this.state.dob_year}
style={{ height: 35, width: 100 }}
onValueChange={(itemValue, itemIndex) =>
this.setState({ dob_year: itemValue })
}>
{year.map((itemValue, itemIndex) => {
return (<Picker.Item label={itemValue} value={itemValue} key={itemIndex} />)
})}
</Picker>
</View>
</View>
)} )}
</View> </View>
...@@ -418,43 +420,43 @@ class NewRegister extends React.Component { ...@@ -418,43 +420,43 @@ class NewRegister extends React.Component {
<View style={styles.itemsRow}> <View style={styles.itemsRow}>
<View style={styles.items1}> <View style={styles.items1}>
<Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}>Gender</Text> <Text style={{ textAlign: 'center', color: '#CFB368', fontWeight: 'bold' }}>{i18n.t('gender')}</Text>
</View> </View>
{Platform.OS === 'ios' ? ( {Platform.OS === 'ios' ? (
<View style={styles.pickerGender}> <View style={styles.pickerGender}>
<RNPickerSelect onValueChange={(value) => this.setState({ gender: value })} <RNPickerSelect onValueChange={(value) => this.setState({ gender: value })}
items={this.state.gender_list} items={this.state.gender_list}
placeholder={{ label: '-- Select --' }} placeholder={{ label: '-- Select --' }}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}} style={{ inputIOSContainer: { paddingVertical: 10, alignItems: 'center' } }}
/> />
</View> </View>
) : ( ) : (
<View style={styles.pickerGender}> <View style={styles.pickerGender}>
<Picker selectedValue={this.state.gender} <Picker selectedValue={this.state.gender}
onValueChange={(itemValue, itemIndex) => this.setState({ gender: itemValue })}> onValueChange={(itemValue, itemIndex) => this.setState({ gender: itemValue })}>
<Picker.Item label='Pilih' value='' /> <Picker.Item label='Pilih' value='' />
{ {
Object.entries(this.state.list_gender).map((item, key) => Object.entries(this.state.list_gender).map((item, key) =>
<Picker.Item label={item[1]} key={key} value={item[0]}> <Picker.Item label={item[1]} key={key} value={item[0]}>
</Picker.Item> </Picker.Item>
) )
} }
</Picker> </Picker>
</View> </View>
)} )}
</View> </View>
<TouchableOpacity onPress={() => this.validate()}> <TouchableOpacity onPress={() => this.validate()}>
<View style={styles.button}> <View style={styles.button}>
<Text style={{ color: 'white', fontWeight: 'bold', fontSize: 22 }}>REGISTER</Text> <Text style={{ color: 'white', fontWeight: 'bold', fontSize: 22 }}>{i18n.t('Register')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Login')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Login')}>
<View style={styles.signin}> <View style={styles.signin}>
<Text style={{ color: '#CFB368' }}>SIGN IN</Text> <Text style={{ color: '#CFB368' }}>{i18n.t('login')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
<View style={{flex : 1}}> <View style={{ flex: 1 }}>
<Image source={require('../assets/images/file-register.png')} resizeMethod='resize' resizeMode='contain' style={{height:300, width:'100%'}}></Image> <Image source={require('../assets/images/file-register.png')} resizeMethod='resize' resizeMode='contain' style={{ height: 300, width: '100%' }}></Image>
</View> </View>
</View> </View>
</ScrollView> </ScrollView>
...@@ -511,7 +513,7 @@ const styles = StyleSheet.create({ ...@@ -511,7 +513,7 @@ const styles = StyleSheet.create({
borderWidth: 1, borderWidth: 1,
borderRadius: 10, borderRadius: 10,
height: 40, height: 40,
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
}, },
titleText: { titleText: {
...@@ -519,7 +521,7 @@ const styles = StyleSheet.create({ ...@@ -519,7 +521,7 @@ const styles = StyleSheet.create({
fontSize: 26, fontSize: 26,
fontWeight: 'bold', fontWeight: 'bold',
color: 'white', color: 'white',
fontFamily : 'Gotham-Black' fontFamily: 'Gotham-Black'
}, },
textInput: { textInput: {
height: 40, height: 40,
...@@ -602,4 +604,4 @@ const mapDispatchToProps = (dispacth) => { ...@@ -602,4 +604,4 @@ const mapDispatchToProps = (dispacth) => {
} }
export default connect(null, mapDispatchToProps)(NewRegister); export default connect(mapStateToProps, mapDispatchToProps)(NewRegister);
\ No newline at end of file \ No newline at end of file
...@@ -6,6 +6,7 @@ import Axios from 'axios'; ...@@ -6,6 +6,7 @@ import Axios from 'axios';
import session from '../function/session'; import session from '../function/session';
import moment from 'moment' import moment from 'moment'
import { Divider } from 'react-native-elements'; import { Divider } from 'react-native-elements';
import i18n from 'i18n-js';
class OrderHistory extends React.Component { class OrderHistory extends React.Component {
...@@ -85,7 +86,7 @@ class OrderHistory extends React.Component { ...@@ -85,7 +86,7 @@ class OrderHistory extends React.Component {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.header}> <View style={styles.header}>
<Text style={{ color: 'white', textAlign: 'center', fontSize: 20, fontFamily: 'Gotham-Black' }}>ORDER HISTORY</Text> <Text style={{ color: 'white', textAlign: 'center', fontSize: 20, fontFamily: 'Gotham-Black' }}>{i18n.t('orderhistory')}</Text>
</View> </View>
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{this.state.indicator == true ? (<ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />) : {this.state.indicator == true ? (<ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />) :
...@@ -115,7 +116,7 @@ class OrderHistory extends React.Component { ...@@ -115,7 +116,7 @@ class OrderHistory extends React.Component {
)) ))
) : ( ) : (
<View style={{ justifyContent: 'center', alignItems: 'center', height: 100 }}> <View style={{ justifyContent: 'center', alignItems: 'center', height: 100 }}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>No Order History</Text> <Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: 'grey' }}>{i18n.t('NotorderHistory')}</Text>
</View> </View>
) )
} }
...@@ -151,6 +152,7 @@ const mapStateToProps = (state) => { ...@@ -151,6 +152,7 @@ const mapStateToProps = (state) => {
return { return {
session_id: state.session_id, session_id: state.session_id,
language: state.language
} }
} }
......
import React, { PureComponent } from 'react'; import React, { PureComponent } from 'react';
import { View, Text, button, StyleSheet, Button, Alert, TextInput, TouchableOpacity,Image } 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';
...@@ -8,6 +8,7 @@ import { StackActions } from '@react-navigation/native'; ...@@ -8,6 +8,7 @@ import { StackActions } from '@react-navigation/native';
import { ScrollView, TouchableHighlight } from 'react-native-gesture-handler'; import { ScrollView, TouchableHighlight } from 'react-native-gesture-handler';
import MyStatusBar from './MyStatusBar'; import MyStatusBar from './MyStatusBar';
class ProfilePage extends PureComponent { class ProfilePage extends PureComponent {
constructor(props) { constructor(props) {
super(props) super(props)
...@@ -18,7 +19,7 @@ class ProfilePage extends PureComponent { ...@@ -18,7 +19,7 @@ class ProfilePage extends PureComponent {
dob_year: '', dob_year: '',
gender: '', gender: '',
email: '', email: '',
mobile_phone:'', mobile_phone: '',
onClicked: false, onClicked: false,
} }
} }
...@@ -35,7 +36,7 @@ class ProfilePage extends PureComponent { ...@@ -35,7 +36,7 @@ class ProfilePage extends PureComponent {
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 => {
let data = res.data let data = res.data
console.log("INI DATANYA : "+JSON.stringify(data)); console.log("INI DATANYA : " + JSON.stringify(data));
this.setState({ this.setState({
full_name: data.name, full_name: data.name,
...@@ -61,7 +62,7 @@ class ProfilePage extends PureComponent { ...@@ -61,7 +62,7 @@ class ProfilePage extends PureComponent {
handleChangeProfil() { handleChangeProfil() {
this.setState({ this.setState({
onClicked:true onClicked: true
}) })
this.props.navigation.navigate('Change Profil', { 'data': 'sample', onChangeProfil: this.onChangeProfil }) this.props.navigation.navigate('Change Profil', { 'data': 'sample', onChangeProfil: this.onChangeProfil })
} }
...@@ -97,71 +98,73 @@ class ProfilePage extends PureComponent { ...@@ -97,71 +98,73 @@ class ProfilePage extends PureComponent {
<View style={styles.container}> <View style={styles.container}>
<MyStatusBar /> <MyStatusBar />
<ScrollView> <ScrollView>
<View style={{ flex: 1, height: 90, top: 10 }}> <View style={{ flex: 1, height: 90, top: 10 }}>
<View style={{ alignSelf: 'center' }}> <View style={{ alignSelf: 'center' }}>
<Image <Image
style={{ height: 70, width: 70, top: 5, justifyContent: 'center' }} style={{ height: 70, width: 70, top: 5, justifyContent: 'center' }}
source={require('../assets/images/people-actv.png')} source={require('../assets/images/people-actv.png')}
/> />
</View> </View>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center', margin: 15 }}>
{this.state.full_name}
</Text>
</View>
<View style={{ flex: 3 }}>
<View style={{ flex: 1, margin: 20,top:10}}>
<View style={{top:20}}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center',margin:3 }}>Email</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.email}</Text>
</View>
<View style={{top:30}}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center',margin:3 }}>Phone</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.mobile_phone}</Text>
</View>
<View style={{top:40}}> <Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center', margin: 15 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center',margin:3}}>Date of Birth</Text> {this.state.full_name}
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.dob_day} / {this.state.dob_month} / {this.state.dob_year}</Text> </Text>
</View>
<View style={{top:50,marginBottom:50}}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center',margin:3 }}>Gender</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.gender}</Text>
</View>
</View> </View>
</View> <View style={{ flex: 3 }}>
<View style={{ flex: 2 }}> <View style={{ flex: 1, margin: 20, top: 10 }}>
<View style={{ flex: 1 }}> <View style={{ top: 20 }}>
<View style={{ top: 10, margin: 5,marginRight:20,marginLeft:20 }}> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center', margin: 3 }}>{i18n.t('email')}</Text>
<View style={{ flex: 1, margin: 5 }}> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center' }}>{this.state.email}</Text>
<TouchableOpacity title="Edit" onPress={() => this.props.navigation.navigate('Change password')}> </View>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368',justifyContent:'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>Change Password</Text> <View style={{ top: 30 }}>
</View> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center', margin: 3 }}>{i18n.t('phone')}</Text>
</TouchableOpacity> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center' }}> {this.state.mobile_phone}</Text>
</View> </View>
<View style={{ top: 40 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center', margin: 3 }}>{i18n.t('dob')}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center' }}>{this.state.dob_day} / {this.state.dob_month} / {this.state.dob_year}</Text>
</View>
<View style={{ top: 50, marginBottom: 50 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 18, textAlign: 'center', margin: 3 }}>{i18n.t('gender')}</Text>
{
this.state.gender == 'Wanita' ? (<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center' }}>{i18n.t('female')}</Text>) : (<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center' }}>{i18n.t('male')}</Text>)
}
</View>
</View> </View>
<View style={{ flex: 1, margin: 5, marginRight:20,marginLeft:20 }}> </View>
<View style={{ flex: 1, margin: 5 }}> <View style={{ flex: 2 }}>
<TouchableOpacity title="Edit" onPress={() => this.props.navigation.navigate('Change language')}> <View style={{ flex: 1 }}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368',justifyContent:'center' }}> <View style={{ top: 10, margin: 5, marginRight: 20, marginLeft: 20 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>Language</Text> <View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity title="Edit" onPress={() => this.props.navigation.navigate('Change password')}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('changepassword')}</Text>
</View>
</TouchableOpacity>
</View> </View>
</TouchableOpacity>
</View> </View>
<View style={{ flex: 1, margin: 5 }}> <View style={{ flex: 1, margin: 5, marginRight: 20, marginLeft: 20 }}>
<TouchableOpacity title="Edit" onPress={() => this.logout()}> <View style={{ flex: 1, margin: 5 }}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368',justifyContent:'center' }}> <TouchableOpacity title="Edit" onPress={() => this.props.navigation.navigate('Change language')}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>Logout</Text> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('language')}</Text>
</View>
</TouchableOpacity>
</View>
<View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity title="Edit" onPress={() => this.logout()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('logout')}</Text>
</View>
</TouchableOpacity>
</View> </View>
</TouchableOpacity>
</View> </View>
</View> </View>
</View> </View>
</View>
</ScrollView> </ScrollView>
</View> </View>
) )
......
...@@ -5,6 +5,7 @@ import { connect } from 'react-redux'; ...@@ -5,6 +5,7 @@ import { connect } from 'react-redux';
import Axios from 'axios'; import Axios from 'axios';
import moment from 'moment' import moment from 'moment'
import MyStatusBar from './MyStatusBar'; import MyStatusBar from './MyStatusBar';
import NumberFormat from 'react-number-format';
class TransactionHistory extends React.Component { class TransactionHistory extends React.Component {
constructor(props) { constructor(props) {
...@@ -16,6 +17,7 @@ class TransactionHistory extends React.Component { ...@@ -16,6 +17,7 @@ class TransactionHistory extends React.Component {
} }
componentDidMount() { componentDidMount() {
console.log(this.props.session_id)
this.getTransactionHistory() this.getTransactionHistory()
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
...@@ -88,43 +90,133 @@ class TransactionHistory extends React.Component { ...@@ -88,43 +90,133 @@ class TransactionHistory extends React.Component {
this.state.history_list.map((item) => ( this.state.history_list.map((item) => (
item.transactions.map((i, k) => ( item.transactions.map((i, k) => (
i.type == 2 ? (
<TouchableOpacity key={k} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}> i.type == 1 ? (
<View style={{ marginTop: 5 }} key={k}> <View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}> <View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}> <View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.outlet}</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.type_display}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text> <Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12, margin: 2 }}>{i.trans_type_display}</Text> </View>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}> <View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginVertical: 5 }}> <View>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 12, textAlign: 'center', paddingHorizontal: 5 }}>Lihat Detail Pemesanan</Text> <Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}></Text>
</View>
</TouchableOpacity>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}>{i.trans_status_display}</Text>
</View>
</View> </View>
</View> </View>
</View> </View>
</TouchableOpacity> </View>
) : ( ) :
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}> i.type == 2 ? (
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}> <TouchableOpacity key={k} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.type_display}</Text> <View style={{ marginTop: 5 }} key={k}>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text> <View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.outlet}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12, margin: 2 }}>{i.trans_type_display}</Text>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', justifyContent: 'center', marginVertical: 5 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 12, textAlign: 'center', paddingHorizontal: 5 }}>Lihat Detail Pemesanan</Text>
</View>
</TouchableOpacity>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}>{i.trans_status_display}</Text>
</View>
</View>
</View> </View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}> </View>
<View> </TouchableOpacity>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}></Text> ) :
i.type == 3 ? (
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.type_display}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<NumberFormat decimalScale={0} value={i.point_add} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View> </View>
</View> </View>
</View> </View>
</View> ) :
)
i.type == 4 ? (
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.type_display}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<NumberFormat decimalScale={0} value={i.point_add} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View>
</View>
</View>
) :
i.type == 5 ? (
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.type_display}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<NumberFormat decimalScale={0} value={i.point_reduce} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>- Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View>
</View>
</View>
) :
i.type == 6 ? (
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.type_display}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<NumberFormat decimalScale={0} value={i.point_add} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View>
</View>
</View>
) : (
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.type_display}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<NumberFormat decimalScale={0} value={i.point_reduce} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>- Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View>
</View>
</View>
)
)) ))
)) ))
......
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