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