Commit 7bdaaae2 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

memperbaiki home

parent 2443fd3d
...@@ -42,7 +42,7 @@ class Home extends React.Component { ...@@ -42,7 +42,7 @@ class Home extends React.Component {
old_balance_claimed: true, old_balance_claimed: true,
member_since: "", member_since: "",
old_balance: 0, old_balance: 0,
expired:'', expired: '',
card_number: '' card_number: ''
} }
} }
...@@ -439,6 +439,7 @@ class Home extends React.Component { ...@@ -439,6 +439,7 @@ class Home extends React.Component {
</Card> </Card>
</View> </View>
) : ) :
//jika member belum punya account kaspro
this.state.account_number == "" ? ( this.state.account_number == "" ? (
<View style={styles.card}> <View style={styles.card}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center', backgroundColor: '#838383' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center', backgroundColor: '#838383' }}>
...@@ -454,6 +455,7 @@ class Home extends React.Component { ...@@ -454,6 +455,7 @@ class Home extends React.Component {
</Card> </Card>
</View> </View>
) : ) :
//jika memeber udah punya account kaspro tapi tidak expired
this.state.account_number !== "" && this.state.is_expired == false ? ( this.state.account_number !== "" && this.state.is_expired == false ? (
<View style={styles.card}> <View style={styles.card}>
<Card style={{ padding: 20, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 20, margin: 10, alignContent: 'center' }}>
...@@ -494,8 +496,11 @@ class Home extends React.Component { ...@@ -494,8 +496,11 @@ class Home extends React.Component {
{this.state.old_balance_claimed == false ? ( {this.state.old_balance_claimed == false ? (
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}> <View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<NumberFormat decimalScale={0} value={this.state.old_balance} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Light', top: 20, textAlign: 'center', color: '#838383' }}> CREDIT : {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} /> <NumberFormat decimalScale={0} value={this.state.old_balance} renderText={value => <Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10, color:'#838383' }}>CREDIT : Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
{/* <Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : {this.state.old_balance} </Text> */} {
this.state.old_balance == 0 ? (
null
) : (
<View style={{ justifyContent: 'center' }}> <View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.handleClaimCredit()}> <TouchableOpacity onPress={() => this.handleClaimCredit()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
...@@ -503,6 +508,8 @@ class Home extends React.Component { ...@@ -503,6 +508,8 @@ class Home extends React.Component {
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
)
}
</View> </View>
</Card>) : (null)} </Card>) : (null)}
</View> </View>
...@@ -515,7 +522,7 @@ class Home extends React.Component { ...@@ -515,7 +522,7 @@ class Home extends React.Component {
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text> <Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>{i18n.t('cardnumber')}</Text>
</View> </View>
<View style={{ flex: 0.5 }}> <View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light',color:'red' }}>{i18n.t('expired')} {this.state.expire_date}</Text> <Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light', color: 'red' }}>{i18n.t('expired')} {this.state.expire_date}</Text>
</View> </View>
</View> </View>
<View style={{ paddingHorizontal: 10 }}> <View style={{ paddingHorizontal: 10 }}>
...@@ -555,7 +562,9 @@ class Home extends React.Component { ...@@ -555,7 +562,9 @@ class Home extends React.Component {
{this.state.old_balance_claimed == false ? ( {this.state.old_balance_claimed == false ? (
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}> <Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}> <View style={{ flex: 1, height: 80, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10 }}>CREDIT : {this.state.old_balance} </Text> <NumberFormat decimalScale={0} value={this.state.old_balance} renderText={value => <Text style={{ fontSize: 14, fontFamily: 'Gotham-Light', textAlign: 'center', marginBottom: 10, color:'#838383' }}>CREDIT : Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
{
this.state.old_balance == 0 ? (null) : (
<View style={{ justifyContent: 'center' }}> <View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.handleClaimCredit()}> <TouchableOpacity onPress={() => this.handleClaimCredit()}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}> <View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368', marginRight: 20, marginLeft: 20, justifyContent: 'center' }}>
...@@ -563,6 +572,9 @@ class Home extends React.Component { ...@@ -563,6 +572,9 @@ class Home extends React.Component {
</View> </View>
</TouchableOpacity> </TouchableOpacity>
</View> </View>
)
}
</View> </View>
</Card>) : (null)} </Card>) : (null)}
</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