Commit 0a4450c2 authored by Trisno's avatar Trisno

loading bar Card number di account

parent 9120deaa
...@@ -9,7 +9,8 @@ import { ...@@ -9,7 +9,8 @@ import {
TouchableOpacity, TouchableOpacity,
Alert, Alert,
Button, Button,
ImageBackground ImageBackground,
ActivityIndicator
} from 'react-native'; } from 'react-native';
import { StackActions } from '@react-navigation/native'; import { StackActions } from '@react-navigation/native';
...@@ -41,7 +42,8 @@ class Account extends React.Component { ...@@ -41,7 +42,8 @@ class Account extends React.Component {
premium: "", premium: "",
my_lat: 0, my_lat: 0,
my_long: 0, my_long: 0,
full_name: '' full_name: '',
indicator: true
} }
} }
...@@ -49,6 +51,9 @@ class Account extends React.Component { ...@@ -49,6 +51,9 @@ class Account extends React.Component {
this._getProfile() this._getProfile()
this._unsubscribe = this.props.navigation.addListener('focus', () => { this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true
})
this._getProfile() this._getProfile()
}); });
} }
...@@ -144,7 +149,8 @@ class Account extends React.Component { ...@@ -144,7 +149,8 @@ class Account extends React.Component {
img_card: img_card, img_card: img_card,
expire_date: expire, expire_date: expire,
premium: premium, premium: premium,
full_name: full_name full_name: full_name,
indicator: false
}) })
}).catch(error => { }).catch(error => {
...@@ -200,7 +206,7 @@ class Account extends React.Component { ...@@ -200,7 +206,7 @@ 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>
<Text style={{ fontFamily: 'Gotham-Light', color: '#838383', fontSize: 12, textAlign: 'center', top: 2 }}>View Profile</Text> <Text style={{ fontFamily: 'Gotham-Light', color: '#838383', fontSize: 12, textAlign: 'center', top: 2 }}>View Profile</Text>
</View> </View>
</View> </View>
</TouchableOpacity> </TouchableOpacity>
...@@ -239,47 +245,55 @@ class Account extends React.Component { ...@@ -239,47 +245,55 @@ class Account extends React.Component {
<View style={styles.Card}> <View style={styles.Card}>
<View style={styles.card}> <View style={styles.card}>
<View style={styles.card}> <View style={styles.card}>
<Card style={{ padding: 20, alignContent: 'center' }}> {
<View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}> this.state.indicator ? (
<View style={{ flex: 0.5 }}> <Card style={{ padding: 50, alignContent: 'center' }}>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>YOUR CARD NUMBER</Text> <ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />
</View> </Card>
<View style={{ flex: 0.5 }}> ) : (
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>Expired At {this.state.expire_date}</Text> <Card style={{ padding: 20, alignContent: 'center' }}>
</View> <View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}>
</View> <View style={{ flex: 0.5 }}>
<View style={{ paddingHorizontal: 10 }}> <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>YOUR CARD NUMBER</Text>
<Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}> </View>
{this.state.account_number} <View style={{ flex: 0.5 }}>
</Text> <Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>Expired At {this.state.expire_date}</Text>
</View> </View>
<View style={styles.line}></View> </View>
<View style={{ paddingHorizontal: 10 }}>
<View style={{ flexDirection: 'row', flex: 1 }}> <Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}> {this.state.account_number}
{/* <Text>{i18n.t('balance')}</Text> */} </Text>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>BALANCE</Text> </View>
</View> <View style={styles.line}></View>
<View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text> <View style={{ flexDirection: 'row', flex: 1 }}>
</View> <View style={{ flex: 0.3, justifyContent: 'center' }}>
</View> {/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>BALANCE</Text>
</View>
<View style={styles.line2}></View> <View style={{ flex: 0.7, alignItems: 'center' }}>
{/* <Text style={{ textAlign: 'left', fontWeight: 'bold' }}> <Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text>
</View>
</View>
<View style={styles.line2}></View>
{/* <Text style={{ textAlign: 'left', fontWeight: 'bold' }}>
{i18n.t('point')} {this.state.point} {i18n.t('point')} {this.state.point}
</Text> */} </Text> */}
<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' }}>POINTS</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>
</View> </View>
</View> </View>
</Card> </Card>
)
}
</View> </View>
</View> </View>
</View> </View>
...@@ -381,8 +395,8 @@ class Account extends React.Component { ...@@ -381,8 +395,8 @@ class Account extends React.Component {
{Platform.OS === 'ios' ? ( {Platform.OS === 'ios' ? (
<Text style={{ color: 'grey', fontSize: 12, textAlign: 'center' }}>Version {Constants.manifest.version} Build {Constants.manifest.ios.buildNumber}</Text> <Text style={{ color: 'grey', fontSize: 12, textAlign: 'center' }}>Version {Constants.manifest.version} Build {Constants.manifest.ios.buildNumber}</Text>
) : ( ) : (
<Text style={{ color: 'grey', fontSize: 12, textAlign: 'center' }}>Version {Constants.manifest.version} Build {Constants.manifest.android.versionCode}</Text> <Text style={{ color: 'grey', fontSize: 12, textAlign: 'center' }}>Version {Constants.manifest.version} Build {Constants.manifest.android.versionCode}</Text>
)} )}
</View> </View>
</ScrollView> </ScrollView>
......
...@@ -65,9 +65,10 @@ class Home extends React.Component { ...@@ -65,9 +65,10 @@ 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,
}) })
} }
this._renderCarousell() this._renderCarousell()
...@@ -376,8 +377,8 @@ class Home extends React.Component { ...@@ -376,8 +377,8 @@ class Home extends React.Component {
{ {
this.state.indicatorProfileCard == true ? ( this.state.indicatorProfileCard == true ? (
<View style={styles.card}> <View style={styles.card}>
<Card style={{ padding: 20, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 50, margin: 10, alignContent: 'center' }}>
<ActivityIndicator style={{ top: 20, justifyContent: "center" }} size="large" color="#c9af6d" /> <ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />
</Card> </Card>
</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