Commit 0d42aa0a authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

Merge branch 'master' of ssh://repo.cs.co.id:2222/wahyu/bahanoprek

# Conflicts:
#	view/Home.js
parents ecbc05a7 88e02761
......@@ -385,20 +385,17 @@ class Home extends React.Component {
) :
this.state.account_number === "" ? (
<View style={styles.card}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Text style={{ textAlign: "center", fontFamily: 'Gotham-Light' }}> {i18n.t('NotActivate')}</Text>
<Text>
</Text>
<Text style={{ textAlign: "center", fontSize: 40, color: '#c9af6d' }}>
</Text>
<View style={styles.line}></View>
<Text style={{ textAlign: 'left', fontWeight: 'bold' }}> {'\n'}
<Card style={{ padding: 10, margin: 10, alignContent: 'center', backgroundColor: '#838383' }}>
<View style={{ flex: 1, backgroundColor: 'grey', height: 150, borderRadius: 20, marginRight: 10, marginLeft: 10, justifyContent: 'center' }}>
<View style={{ justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Card Activation')}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}> {i18n.t('Acitvatecard')}</Text>
</View>
</TouchableOpacity>
</View>
</Text>
<View style={styles.line}></View>
<Text style={{ textAlign: 'left', fontWeight: 'bold' }}>{'\n'}
</Text>
</View>
</Card>
</View>
) :
......@@ -672,7 +669,7 @@ const mapStateToProps = (state) => {
// login
in_payment: state.in_payment,
BASE_URL : state.BASE_URL,
BASE_URL: state.BASE_URL,
email: state.email,
outlet_id: state.outlet_id,
name_outlet: state.name_outlet,
......
......@@ -59,19 +59,19 @@ class NewRegister extends React.Component {
let date_list = []
for (let i = 1; i <= 31; i++) {
date_list.push({label: String(i), value: i});
date_list.push({ label: String(i), value: i });
}
let month_list = []
for (let i = 1; i <= 12; i++) {
const month_name = month[i];
month_list.push({label: month_name, value: i});
month_list.push({ label: month_name, value: i });
}
let year_list = []
let current_year = new Date().getFullYear();
let start_year = current_year - 65;
let end_year = current_year - 13;
for (let i = start_year; i <= end_year; i++) {
year_list.push({label: String(i), value: i});
year_list.push({ label: String(i), value: i });
}
this.setState({
date: date_list,
......@@ -91,7 +91,7 @@ class NewRegister extends React.Component {
for (const key in list_gender) {
if (list_gender.hasOwnProperty(key)) {
const row = list_gender[key];
gender_list.push({label: row, value: key})
gender_list.push({ label: row, value: key })
}
}
this.setState({
......@@ -245,16 +245,18 @@ class NewRegister extends React.Component {
this.props.navigation.navigate('Email Confirmation')
}).catch(error => {
this.setState({
spinner: false,
})
// console.log(JSON.stringify(error.response));
let response = error.response.data;
Alert.alert(
'',
response.msg,
[
{ text: 'OK' }
{
text: 'OK', onPress: () => this.setState({
spinner: false,
})
}
]
)
})
......@@ -351,21 +353,21 @@ class NewRegister extends React.Component {
<RNPickerSelect onValueChange={(value) => this.setState({ dob_day: value })}
items={this.state.date}
placeholder={{ label: '-- Select --' }}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}}
style={{ inputIOSContainer: { paddingVertical: 10, alignItems: 'center' } }}
/>
</View>
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<RNPickerSelect onValueChange={(value) => this.setState({ dob_month: value })}
items={this.state.month}
placeholder={{ label: '-- Select --' }}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}}
style={{ inputIOSContainer: { paddingVertical: 10, alignItems: 'center' } }}
/>
</View>
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center', marginRight: 10 }}>
<RNPickerSelect onValueChange={(value) => this.setState({ dob_year: value })}
items={this.state.year}
placeholder={{ label: '-- Select --' }}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}}
style={{ inputIOSContainer: { paddingVertical: 10, alignItems: 'center' } }}
/>
</View>
</View>
......@@ -425,7 +427,7 @@ class NewRegister extends React.Component {
<RNPickerSelect onValueChange={(value) => this.setState({ gender: value })}
items={this.state.gender_list}
placeholder={{ label: '-- Select --' }}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}}
style={{ inputIOSContainer: { paddingVertical: 10, alignItems: 'center' } }}
/>
</View>
) : (
......@@ -453,8 +455,8 @@ class NewRegister extends React.Component {
<Text style={{ color: '#CFB368' }}>{i18n.t('login')}</Text>
</View>
</TouchableOpacity>
<View style={{flex : 1}}>
<Image source={require('../assets/images/file-register.png')} resizeMethod='resize' resizeMode='contain' style={{height:300, width:'100%'}}></Image>
<View style={{ flex: 1 }}>
<Image source={require('../assets/images/file-register.png')} resizeMethod='resize' resizeMode='contain' style={{ height: 300, width: '100%' }}></Image>
</View>
</View>
</ScrollView>
......@@ -519,7 +521,7 @@ const styles = StyleSheet.create({
fontSize: 26,
fontWeight: 'bold',
color: 'white',
fontFamily : 'Gotham-Black'
fontFamily: 'Gotham-Black'
},
textInput: {
height: 40,
......
......@@ -5,6 +5,7 @@ import { connect } from 'react-redux';
import Axios from 'axios';
import moment from 'moment'
import MyStatusBar from './MyStatusBar';
import NumberFormat from 'react-number-format';
class TransactionHistory extends React.Component {
constructor(props) {
......@@ -16,6 +17,7 @@ class TransactionHistory extends React.Component {
}
componentDidMount() {
console.log(this.props.session_id)
this.getTransactionHistory()
this._unsubscribe = this.props.navigation.addListener('focus', () => {
......@@ -88,6 +90,23 @@ class TransactionHistory extends React.Component {
this.state.history_list.map((item) => (
item.transactions.map((i, k) => (
i.type == 1 ? (
<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>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}></Text>
</View>
</View>
</View>
</View>
) :
i.type == 2 ? (
<TouchableOpacity key={k} onPress={() => this.props.navigation.navigate('Order Detail', { idTrans: i.id })}>
<View style={{ marginTop: 5 }} key={k}>
......@@ -110,6 +129,70 @@ class TransactionHistory extends React.Component {
</View>
</View>
</TouchableOpacity>
) :
i.type == 3 ? (
<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>
) :
i.type == 4 ? (
<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>
) :
i.type == 5 ? (
<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_reduce} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>- Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View>
</View>
</View>
) :
i.type == 6 ? (
<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>
) : (
<View style={{ marginTop: 5 }} key={k}>
<View style={{ flex: 2, height: 120, margin: 5, borderRadius: 5, borderWidth: 1, borderColor: '#838383', flexDirection: 'row' }}>
......@@ -119,13 +202,22 @@ class TransactionHistory extends React.Component {
</View>
<View style={{ flex: 0.9, justifyContent: 'center', alignItems: 'center', margin: 10, marginLeft: 15, borderLeftWidth: 1, borderColor: '#838383' }}>
<View>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 12 }}></Text>
<NumberFormat decimalScale={0} value={i.point_reduce} renderText={value => <Text style={{ fontSize: 12, fontFamily: 'Gotham-Black', color: '#CFB368' }}>- Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
</View>
</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