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

translate profil page

parent bd517c54
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 })
}
......@@ -110,52 +111,54 @@ class ProfilePage extends PureComponent {
</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 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 }}>Phone</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.mobile_phone}</Text>
<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}}>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 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 }}>Gender</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 14, textAlign: 'center'}}>{this.state.gender}</Text>
<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: 2 }}>
<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 }}>
<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 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>
<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 }}>
<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 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' }}>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('logout')}</Text>
</View>
</TouchableOpacity>
</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