Commit b310545b authored by William Goszal's avatar William Goszal 🚴

fix transaction history kurang conditional buat claim balance

parent 55e1f394
...@@ -39,7 +39,7 @@ class TransactionHistory extends React.Component { ...@@ -39,7 +39,7 @@ class TransactionHistory extends React.Component {
let params = { let params = {
session_id: this.props.session_id session_id: this.props.session_id
} }
Axios.post(this.props.BASE_URL+'crm/v2/transaction/history', params).then(res => { Axios.post(this.props.BASE_URL + 'crm/v2/transaction/history', params).then(res => {
let data = res.data.transactions let data = res.data.transactions
console.log(data) console.log(data)
data.map((item) => { data.map((item) => {
...@@ -93,6 +93,7 @@ class TransactionHistory extends React.Component { ...@@ -93,6 +93,7 @@ class TransactionHistory extends React.Component {
item.transactions.map((i, k) => ( item.transactions.map((i, k) => (
/** TYPE_CARD_ACTIVATION */
i.type == 1 ? ( i.type == 1 ? (
<View style={{ marginTop: 5 }} key={k}> <View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}> <View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
...@@ -109,6 +110,7 @@ class TransactionHistory extends React.Component { ...@@ -109,6 +110,7 @@ class TransactionHistory extends React.Component {
</View> </View>
) : ) :
/** TYPE_TRANSACTION */
i.type == 2 ? ( i.type == 2 ? (
<TouchableOpacity key={k} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}> <TouchableOpacity key={k} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}>
<View style={{ marginTop: 5 }} key={k}> <View style={{ marginTop: 5 }} key={k}>
...@@ -133,6 +135,7 @@ class TransactionHistory extends React.Component { ...@@ -133,6 +135,7 @@ class TransactionHistory extends React.Component {
</TouchableOpacity> </TouchableOpacity>
) : ) :
/** TYPE_TOPUP_CASHBACK */
i.type == 3 ? ( i.type == 3 ? (
<View style={{ marginTop: 5 }} key={k}> <View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}> <View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
...@@ -149,6 +152,7 @@ class TransactionHistory extends React.Component { ...@@ -149,6 +152,7 @@ class TransactionHistory extends React.Component {
</View> </View>
) : ) :
/** TYPE_TRANS_CASHBACK */
i.type == 4 ? ( i.type == 4 ? (
<View style={{ marginTop: 5 }} key={k}> <View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}> <View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
...@@ -165,6 +169,7 @@ class TransactionHistory extends React.Component { ...@@ -165,6 +169,7 @@ class TransactionHistory extends React.Component {
</View> </View>
) : ) :
/** TYPE_TRANSFER_BALANCE */
i.type == 5 ? ( i.type == 5 ? (
<View style={{ marginTop: 5 }} key={k}> <View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}> <View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
...@@ -181,6 +186,7 @@ class TransactionHistory extends React.Component { ...@@ -181,6 +186,7 @@ class TransactionHistory extends React.Component {
</View> </View>
) : ) :
/** TYPE_TRANSFER_RECEIVE */
i.type == 6 ? ( i.type == 6 ? (
<View style={{ marginTop: 5 }} key={k}> <View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}> <View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
...@@ -195,7 +201,27 @@ class TransactionHistory extends React.Component { ...@@ -195,7 +201,27 @@ class TransactionHistory extends React.Component {
</View> </View>
</View> </View>
</View> </View>
) : ( ) :
/** TYPE_CLAIM_BALANCE */
i.type == 8 ? (
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 12, margin: 2 }}>{i.type_display}</Text>
<Text style={{ fontFamily: 'Gotham-Light', color: 'grey', fontSize: 12, margin: 2 }}>{moment(i.trans_time).format("DD MMMM YYYY, hh:mm A")}</Text>
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<NumberFormat decimalScale={0} value={i.point_add} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View>
</View>
</View>
) :
/** TYPE_RENEWAL */
(
<View style={{ marginTop: 5 }} key={k}> <View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}> <View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
<View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}> <View style={{ flex: 1.1, justifyContent: 'center', margin: 10 }}>
......
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