Commit a3d9dec7 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo
parents 94174c65 6755d13a
...@@ -259,18 +259,18 @@ class Auth extends React.Component { ...@@ -259,18 +259,18 @@ class Auth extends React.Component {
}, title: 'CHANGE PASSWORD' }, title: 'CHANGE PASSWORD'
}} /> }} />
<Stack.Screen name="Card Activation" component={CardActivation} options={{ <Stack.Screen name="Card Activation" component={CardActivation} options={{
headerStyle: { backgroundColor: '#CFB368' }, headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' }, headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center', headerTitleAlign: 'center',
headerTintColor: '#fff', headerTintColor: '#fff',
headerTitleStyle: { headerTitleStyle: {
alignSelf: 'center', alignSelf: 'center',
fontFamily: 'Gotham-Black', fontFamily: 'Gotham-Black',
fontSize: 18, fontSize: 18,
color: 'white', color: 'white',
textAlign: 'center' textAlign: 'center'
}, title: 'ACTIVATE CARD' }, title: 'ACTIVATE CARD'
}} /> }} />
<Stack.Screen name="Renewal" component={Renewal} options={{ <Stack.Screen name="Renewal" component={Renewal} options={{
headerStyle: { backgroundColor: '#CFB368' }, headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' }, headerTitleContainerStyle: { alignContent: 'center' },
...@@ -326,16 +326,18 @@ class Auth extends React.Component { ...@@ -326,16 +326,18 @@ class Auth extends React.Component {
}, title: 'Tambah Alamat' }, title: 'Tambah Alamat'
}} /> }} />
<Stack.Screen name="Menu Detail" component={MenuDetail} <Stack.Screen name="Menu Detail" component={MenuDetail}
options={({ route }) => ({ headerStyle: { backgroundColor: '#CFB368' }, options={({ route }) => ({
headerTitleContainerStyle: { alignContent: 'center' }, headerStyle: { backgroundColor: '#CFB368' },
headerTitleAlign: 'center', headerTitleContainerStyle: { alignContent: 'center' },
headerTintColor: '#fff', headerTitleAlign: 'center',
headerTitleStyle: { headerTintColor: '#fff',
alignSelf: 'center', headerTitleStyle: {
fontFamily: 'Gotham-Black', alignSelf: 'center',
color: 'white', fontFamily: 'Gotham-Black',
textAlign: 'center' color: 'white',
}, title: route.params.nameMenu })} textAlign: 'center'
}, title: route.params.nameMenu
})}
/> />
<Stack.Screen name="Pickup Name" component={PickupName} options={{ <Stack.Screen name="Pickup Name" component={PickupName} options={{
headerStyle: { backgroundColor: '#CFB368' }, headerStyle: { backgroundColor: '#CFB368' },
...@@ -352,7 +354,20 @@ class Auth extends React.Component { ...@@ -352,7 +354,20 @@ class Auth extends React.Component {
<Stack.Screen name="Outlet Detail" component={OutletDetail} /> <Stack.Screen name="Outlet Detail" component={OutletDetail} />
<Stack.Screen name="Menu Select" component={MenuSelection} options={{ headerShown: false }} /> <Stack.Screen name="Menu Select" component={MenuSelection} options={{ headerShown: false }} />
<Stack.Screen name="Card Info" component={CardInfo} /> <Stack.Screen name="Card Info" component={CardInfo} />
<Stack.Screen name="Shopping Cart" component={ShoppingCart} /> <Stack.Screen name="Shopping Cart" component={ShoppingCart}
options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
fontSize: 18,
color: 'white',
textAlign: 'center'
}, title: 'Shopping Cart'
}} />
<Stack.Screen name="Order History" component={OrderHistory} /> <Stack.Screen name="Order History" component={OrderHistory} />
<Stack.Screen name="Reward History" component={RewardHistory} <Stack.Screen name="Reward History" component={RewardHistory}
options={{ options={{
...@@ -457,6 +472,22 @@ class Auth extends React.Component { ...@@ -457,6 +472,22 @@ class Auth extends React.Component {
title: 'TRANSACTION HISTORY' title: 'TRANSACTION HISTORY'
}} /> }} />
<Stack.Screen name="Transaction Detail" component={TransactionDetail} <Stack.Screen name="Transaction Detail" component={TransactionDetail}
options={{
headerStyle: { backgroundColor: "#CFB368" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 18,
},
title: 'TRANSACTION DETAIL'
}} />
{/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */}
<Stack.Screen name="News Detail" component={NewsDetail} options={{ headerShown: false }} />
<Stack.Screen name="Confirm Your Order" component={MenuConfirmation}
options={{ options={{
headerStyle: { backgroundColor: "#CFB368" }, headerStyle: { backgroundColor: "#CFB368" },
headerBackTitleStyle: { color: 'white' }, headerBackTitleStyle: { color: 'white' },
...@@ -467,12 +498,8 @@ class Auth extends React.Component { ...@@ -467,12 +498,8 @@ class Auth extends React.Component {
color: 'white', color: 'white',
fontSize: 18, fontSize: 18,
}, },
title: 'TRANSACTION DETAIL' title: 'Confirm Your Order'
}} /> }} />
{/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */}
<Stack.Screen name="News Detail" component={NewsDetail} options={{ headerShown: false }} />
<Stack.Screen name="Confirm Your Order" component={MenuConfirmation} />
<Stack.Screen name="Date Time" component={DateTime} /> <Stack.Screen name="Date Time" component={DateTime} />
<Stack.Screen name="New Register" component={NewRegister} <Stack.Screen name="New Register" component={NewRegister}
options={{ options={{
......
...@@ -2,6 +2,7 @@ import React from 'react'; ...@@ -2,6 +2,7 @@ import React from 'react';
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image, TextInput } from 'react-native'; import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image, TextInput } from 'react-native';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import NumberFormat from 'react-number-format';
class ItemShoping extends React.Component { class ItemShoping extends React.Component {
...@@ -21,40 +22,42 @@ class ItemShoping extends React.Component { ...@@ -21,40 +22,42 @@ class ItemShoping extends React.Component {
note: 'jangan garing', note: 'jangan garing',
image: item.image, image: item.image,
price: parseInt(item.price), price: parseInt(item.price),
} }
this.props.changeQuantity({item: order_item, quantity: quantity}) this.props.changeQuantity({ item: order_item, quantity: quantity })
} }
render() { render() {
const { item } = this.props const { item } = this.props
// console.log(this.props) // console.log(this.props)
return ( return (
<View style={{ flex: 1, margin: 10 }} key={item.id}> <View style={{ flex: 1, margin: 10 }} key={item.id}>
{/* <Text style={{ fontSize: 20, color: '#c9af6d' }}>{item.name}</Text> */} {/* <Text style={{ fontSize: 20, color: '#c9af6d' }}>{item.name}</Text> */}
<View style={{ flexDirection: 'row' }}> <View style={{ flexDirection: 'row' }}>
<View > <View >
<Image source={{ uri: item.image }} style={{ height: 100, width: 100, borderRadius: 5, top: 5 }}></Image> <Image source={{ uri: item.image }} style={{ height: 100, width: 100, borderRadius: 5, top: 5 }}></Image>
</View> </View>
<View > <View >
<Text style={{ fontSize: 20, margin: 5, marginRight: 10, fontFamily: 'Gotham-Black' }}>{item.name}</Text> <Text style={{ fontSize: 15, margin: 5, marginRight: 10, fontFamily: 'Gotham-Black', color: 'grey' }}>{item.name}</Text>
<Text style={{ fontSize: 15, margin: 5, marginRight: 10, fontFamily: 'Gotham-Light'}}>Rp. {item.price}</Text> <NumberFormat decimalScale={0} value={item.price} renderText={value => <Text style={{ fontSize: 12, margin: 5, marginRight: 10, fontFamily: 'Gotham-Light', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
<View style={{ flexDirection: 'row', flex: 1 }}> <View style={{ flexDirection: 'row', flex: 1 }}>
<View style={styles.shadowEdit}></View> <View style={styles.shadowEdit}>
<View style={styles.shadowAdd}> <Image source={(require('../assets/icon/icon-pencil.png'))} style={{ height: 25, width: 25, marginLeft: 5}}></Image>
<TouchableOpacity onPress={() => this.props.handleMin()}> </View>
<Text style={{ fontSize: 20, margin: 2, color:'#CFB368' }}> - </Text> <View style={styles.shadowAdd}>
</TouchableOpacity> <TouchableOpacity onPress={() => this.props.handleMin()}>
<TextInput <Text style={{ fontSize: 20, margin: 2, color: '#CFB368' }}> - </Text>
style={{ height: 25, padding: 2, textAlign: 'center', margin: 2 }} </TouchableOpacity>
keyboardType={'numeric'} <TextInput
onChangeText={(quantity) => this.handleChangeQuantity(item, quantity)}>{item.quantity}</TextInput> style={{ height: 25, padding: 2, textAlign: 'center', margin: 2 }}
<TouchableOpacity onPress={() => this.props.handleAdd()}> keyboardType={'numeric'}
<Text style={{ fontSize: 20, margin: 2, color:'#CFB368'}}> + </Text> onChangeText={(quantity) => this.handleChangeQuantity(item, quantity)}>{item.quantity}</TextInput>
</TouchableOpacity> <TouchableOpacity onPress={() => this.props.handleAdd()}>
</View> <Text style={{ fontSize: 20, margin: 2, color: '#CFB368' }}> + </Text>
</TouchableOpacity>
</View> </View>
</View> </View>
</View> </View>
</View>
</View> </View>
) )
} }
...@@ -76,6 +79,7 @@ const styles = StyleSheet.create({ ...@@ -76,6 +79,7 @@ const styles = StyleSheet.create({
marginLeft: 5, marginLeft: 5,
marginRight: 5, marginRight: 5,
marginTop: 10, marginTop: 10,
alignItems:'center'
}, },
shadowAdd: { shadowAdd: {
height: 30, height: 30,
...@@ -125,14 +129,14 @@ const mapStateToProps = (state) => { ...@@ -125,14 +129,14 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispacth) => { const mapDispatchToProps = (dispacth) => {
return { return {
changeQuantity: (params) => dispacth({ changeQuantity: (params) => dispacth({
type: ActionType.CHANGE_QUANTITY, type: ActionType.CHANGE_QUANTITY,
data: { data: {
item: params.item, item: params.item,
new_quantity: params.quantity new_quantity: params.quantity
} }
}), }),
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(ItemShoping) export default connect(mapStateToProps, mapDispatchToProps)(ItemShoping)
This diff is collapsed.
...@@ -89,30 +89,36 @@ class RewardSelect extends React.Component { ...@@ -89,30 +89,36 @@ class RewardSelect extends React.Component {
</View> */} </View> */}
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{ {
this.state.rewardsList.map((item, key) => ( this.state.rewardsList.length ? (
<TouchableOpacity key={key} onPress={() => this.handleSelect(item)}> this.state.rewardsList.map((item, key) => (
<View style={{ alignItems: 'center' }}> <TouchableOpacity key={key} onPress={() => this.handleSelect(item)}>
<Card style={{ padding: 5, margin: 10 }}> <View style={{ alignItems: 'center' }}>
<View> <Card style={{ padding: 5, margin: 10 }}>
<Image source={{ uri: item.reward.title_image }}
resizeMethod="resize"
resizeMode='cover'
style={{ height: 100, width: '100%' }} />
</View>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View> <View>
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Black'}}>{item.reward.title}</Text> <Image source={{ uri: item.reward.title_image }}
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.reward.subtitle}</Text> resizeMethod="resize"
resizeMode='cover'
style={{ height: 100, width: '100%' }} />
</View> </View>
<View> <View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>Expired</Text> <View>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.expire_time}</Text> <Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Black' }}>{item.reward.title}</Text>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.reward.subtitle}</Text>
</View>
<View>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light' }}>Expired</Text>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.expire_time}</Text>
</View>
</View> </View>
</View> </Card>
</Card> </View>
</TouchableOpacity>
))
) : (
<View style={{justifyContent:'center', alignItems:'center', height:100}}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color:'grey' }}>No E-Voucher Available</Text>
</View> </View>
</TouchableOpacity> )
))
} }
{/* <TouchableOpacity> {/* <TouchableOpacity>
<Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text> <Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text>
......
...@@ -32,9 +32,9 @@ class RewardsList extends React.Component { ...@@ -32,9 +32,9 @@ class RewardsList extends React.Component {
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/get_list', params).then(res => { Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/reward/get_list', params).then(res => {
let data = res.data.rewards let data = res.data.rewards
// console.log(data) // console.log(data)
data.map((item,key) => { data.map((item, key) => {
// console.log(item.expire_time) // console.log(item.expire_time)
item.expire_time = moment(item.expire_time).format("DD MMMM YYYY") item.expire_time = moment(item.expire_time).format("DD MMMM YYYY")
}) })
// console.log(data) // console.log(data)
this.setState({ this.setState({
...@@ -55,35 +55,41 @@ class RewardsList extends React.Component { ...@@ -55,35 +55,41 @@ class RewardsList extends React.Component {
</View> </View>
<ScrollView style={styles.body}> <ScrollView style={styles.body}>
{ {
this.state.rewardsList.map((item, key) => ( this.state.rewardsList.length ? (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: item.id })}> this.state.rewardsList.map((item, key) => (
<View style={{ alignItems: 'center' }}> <TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: item.id })}>
<Card style={{ padding: 5, margin: 10 }}> <View style={{ alignItems: 'center' }}>
<View> <Card style={{ padding: 5, margin: 10 }}>
<Image source={{ uri: item.reward.title_image }}
resizeMethod="resize"
resizeMode='cover'
style={{ height: 100, width: '100%' }} />
</View>
<View style={{ flexDirection: 'row', justifyContent:'space-between', padding:10 }}>
<View> <View>
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Black'}}>{item.reward.title}</Text> <Image source={{ uri: item.reward.title_image }}
<Text style={{textAlign:'left', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.reward.subtitle}</Text> resizeMethod="resize"
resizeMode='cover'
style={{ height: 100, width: '100%' }} />
</View> </View>
<View> <View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>Expired</Text> <View>
<Text style={{textAlign:'right', fontSize: 12, fontFamily: 'Gotham-Light'}}>{item.expire_time}</Text> <Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Black' }}>{item.reward.title}</Text>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.reward.subtitle}</Text>
</View>
<View>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light' }}>Expired</Text>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light' }}>{item.expire_time}</Text>
</View>
</View> </View>
</View> </Card>
</Card> </View>
</TouchableOpacity>
))
) : (
<View style={{ justifyContent: 'center', alignItems: 'center', height: 100 }}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color:'grey' }}>No E-Voucher Available</Text>
</View> </View>
</TouchableOpacity> )
))
} }
<TouchableOpacity onPress={()=> this.props.navigation.navigate('Reward History')}> <TouchableOpacity onPress={() => this.props.navigation.navigate('Reward History')}>
<Text style={{ textAlign: 'center', color: '#CFB368', fontSize: 12, fontFamily: 'Gotham-Black' }}>REDEEM E-VOUCHER HISTORY</Text> <Text style={{ textAlign: 'center', color: '#CFB368', fontSize: 12, fontFamily: 'Gotham-Black' }}>REDEEM E-VOUCHER HISTORY</Text>
</TouchableOpacity> </TouchableOpacity>
<View style={{height:15}}/> <View style={{ height: 15 }} />
</ScrollView> </ScrollView>
</View> </View>
) )
......
This diff is collapsed.
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