Commit 0a4450c2 authored by Trisno's avatar Trisno

loading bar Card number di account

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