Commit 70c810b2 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

translate profil page

parent bd517c54
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 })
} }
...@@ -110,52 +111,54 @@ class ProfilePage extends PureComponent { ...@@ -110,52 +111,54 @@ class ProfilePage extends PureComponent {
</Text> </Text>
</View> </View>
<View style={{ flex: 3 }}> <View style={{ flex: 3 }}>
<View style={{ flex: 1, margin: 20,top:10}}> <View style={{ flex: 1, margin: 20, top: 10 }}>
<View style={{top:20}}> <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: '#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> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center' }}>{this.state.email}</Text>
</View> </View>
<View style={{top:30}}> <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: '#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> <Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center' }}> {this.state.mobile_phone}</Text>
</View> </View>
<View style={{top:40}}> <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: '#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> <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>
<View style={{top:50,marginBottom:50}}> <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: '#CFB368', fontSize: 18, textAlign: 'center', margin: 3 }}>{i18n.t('gender')}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.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>
</View> </View>
<View style={{ flex: 2 }}> <View style={{ flex: 2 }}>
<View style={{ flex: 1 }}> <View style={{ flex: 1 }}>
<View style={{ top: 10, margin: 5,marginRight:20,marginLeft:20 }}> <View style={{ top: 10, margin: 5, marginRight: 20, marginLeft: 20 }}>
<View style={{ flex: 1, margin: 5 }}> <View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity title="Edit" onPress={() => this.props.navigation.navigate('Change password')}> <TouchableOpacity title="Edit" onPress={() => this.props.navigation.navigate('Change password')}>
<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' }}>Change Password</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('changepassword')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
</View> </View>
<View style={{ flex: 1, margin: 5, marginRight:20,marginLeft:20 }}> <View style={{ flex: 1, margin: 5, marginRight: 20, marginLeft: 20 }}>
<View style={{ flex: 1, margin: 5 }}> <View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity title="Edit" onPress={() => this.props.navigation.navigate('Change language')}> <TouchableOpacity title="Edit" onPress={() => this.props.navigation.navigate('Change language')}>
<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' }}>Language</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('language')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
<View style={{ flex: 1, margin: 5 }}> <View style={{ flex: 1, margin: 5 }}>
<TouchableOpacity title="Edit" onPress={() => this.logout()}> <TouchableOpacity title="Edit" onPress={() => this.logout()}>
<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' }}>Logout</Text> <Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 16, textAlign: 'center' }}>{i18n.t('logout')}</Text>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</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