Commit ccd3831e authored by Trisno's avatar Trisno
parents 6c2952f9 fe4cca37
{
"expo": {
"name": "Excelso_update 09.00 / 14.05.2020",
"name": "Excelso_update 13.00 / 18.05.2020",
"slug": "excelso-pro",
"privacy": "public",
"sdkVersion": "36.0.0",
......
This diff is collapsed.
......@@ -7130,6 +7130,14 @@
}
}
},
"react-number-format": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/react-number-format/-/react-number-format-4.4.1.tgz",
"integrity": "sha512-ZGFMXZ0U7DcmQ3bSZY3FULOA1mfqreT9NIMYZNoa/ouiSgiTQiYA95Uj2KN8ge6BRr+ghA5vraozqWqsHZQw3Q==",
"requires": {
"prop-types": "^15.7.2"
}
},
"react-redux": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.2.0.tgz",
......
......@@ -66,6 +66,7 @@
"react-native-web": "~0.11.7",
"react-native-webview": "^7.4.3",
"react-navigation": "^4.2.2",
"react-number-format": "^4.4.1",
"react-redux": "^7.2.0",
"react-redux-i18n": "^1.9.3",
"redux": "^4.0.5",
......
......@@ -38,7 +38,8 @@ class Account extends React.Component {
expire_date: "",
premium: "",
my_lat: 0,
my_long: 0
my_long: 0,
full_name:''
}
}
......@@ -103,7 +104,6 @@ class Account extends React.Component {
}
Axios.post('https://excelsocrm.ravintoladev.com/crm/v2/member/get_profile', params).then(res => {
console.log('WAKWAWWWW ' + JSON.stringify(res.data))
const dataCard = res.data
let email = dataCard.email
let point = dataCard.kaspro_point
......@@ -113,6 +113,7 @@ class Account extends React.Component {
let expire = dataCard.expire_date
let premium = dataCard.kaspro_is_premium
let kaspro = dataCard.kaspro_account_number
let full_name = dataCard.name
if (kaspro === "") {
......@@ -141,6 +142,7 @@ class Account extends React.Component {
img_card: img_card,
expire_date: expire,
premium: premium,
full_name:full_name
})
}).catch(error => {
......@@ -181,17 +183,24 @@ class Account extends React.Component {
source={require('../assets/images/people-actv.png')}
/>
</View>
<View style={{ height: 60, flexDirection: 'row', justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center', margin: 15 }}>
{this.state.email} {this.props.set_card}
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20, textAlign: 'center',top:5 }}>
{this.state.full_name}
</Text>
<View style={{ height: 90, flexDirection: 'row', justifyContent: 'center' }}>
<TouchableOpacity style={{flexDirection:'row'}} onPress={() => this.props.navigation.navigate('Profile')}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 17, textAlign: 'center',top:10 }}>
{this.state.email}
</Text>
</TouchableOpacity>
<Icon
containerStyle={{ top: 8 }}
containerStyle={{margin:5}}
name='ios-create'
type='ionicon'
color='#CFB368'
/>
</TouchableOpacity>
</View>
</View>
......@@ -228,7 +237,7 @@ class Account extends React.Component {
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', top: 20 }}>No card yet</Text>
<TouchableOpacity onPress={() => this.handleLoggin()}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: 'white', marginRight: 20, marginLeft: 20, top: 90 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}>ACTIVATION CARD</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}>ACTIVATE CARD</Text>
</View>
</TouchableOpacity>
</View>
......@@ -244,18 +253,18 @@ class Account extends React.Component {
<View style={styles.Card}>
<Card style={{ padding: 10, margin: 20, alignContent: 'center' }}>
<Text style={{fontSize:12, fontFamily: 'Gotham-Black', }}>
YOUR CARD NUMBER | EXPIRED ON {this.state.expire_date}{'\n'}
YOUR CARD NUMBER | <Text style={{fontFamily:'Gotham-Light'}}>EXPIRED ON </Text> <Text style={{fontFamily:'Gotham-Light'}}>{this.state.expire_date}</Text> {'\n'}
</Text>
<Text style={{ fontFamily: 'Gotham-Black', textAlign: "center", fontSize: 40, color: '#c9af6d' }}>
{this.state.account_number}
</Text>
<View style={styles.line}></View>
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left', fontWeight: 'bold' }}> {'\n'}
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left',fontSize:15 }}> {'\n'}
BALANCE : {this.state.balance}{'\n'}
</Text>
<View style={styles.line}></View>
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left', fontWeight: 'bold' }}>{'\n'}
POINTS : {this.state.points}
<Text style={{fontFamily: 'Gotham-Light', textAlign: 'left',fontSize:15 }}> {'\n'}
POINTS : {this.state.points}{'\n'}
</Text>
</Card>
</View>
......@@ -360,7 +369,8 @@ const styles = StyleSheet.create({
},
Card: {
top: 50,
top: 60,
alignItems: 'center',
backgroundColor: 'white',
alignContent: 'center',
......@@ -369,11 +379,20 @@ const styles = StyleSheet.create({
line: {
top:3,
borderRadius:1,
borderColor:'#c9af6d',
borderColor:'black',
borderWidth:1,
width: "100%",
height: 1,
bottom: 5,
},
line1: {
top:3,
borderRadius:1,
borderColor:'black',
borderWidth:1,
alignSelf: 'stretch',
width: "100%",
height: 3,
height: 1,
bottom: 5,
},
......
This diff is collapsed.
......@@ -269,8 +269,30 @@ class Auth extends React.Component {
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} />
<Stack.Screen name="Upgrade Premium" component={UpgradePremium} />
<Stack.Screen name="Camera" component={Cameras} />
<Stack.Screen name="Delivery Address" component={DeliveryAddress} />
<Stack.Screen name="Address Detail" component={AddressDetail} />
<Stack.Screen name="Delivery Address" component={DeliveryAddress} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'Delivery Address'
}} />
<Stack.Screen name="Address Detail" component={AddressDetail} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color: 'white',
textAlign: 'center'
}, title: 'Tambah Alamat'
}} />
<Stack.Screen name="Menu Detail" component={MenuDetail} />
<Stack.Screen name="Pickup Name" component={PickupName} options={{
headerStyle: { backgroundColor: '#CFB368' },
......
This diff is collapsed.
import React from 'react';
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image, TextInput } from 'react-native';
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Image, TextInput,Modal } from 'react-native';
import { connect } from 'react-redux';
import ActionType from '../redux/globalActionType';
import NumberFormat from 'react-number-format';
class Item extends React.Component {
......@@ -15,7 +16,7 @@ class Item extends React.Component {
handleChangeQuantity = (item, qty) => {
if (qty == '') {
item.qty=0
item.qty = 0
} else {
const order_item = {
......@@ -40,28 +41,34 @@ class Item extends React.Component {
<View style={{ flex: 1, margin: 10 }} key={item.id} ref={this.props._scrollView}>
<ScrollView ref={view => this._scrollView = view}>
{item.code == 'CATEGORY' ? (
<Text style={{ fontSize: 20, color: '#c9af6d' }}>{item.name}</Text>
<Text style={{ fontSize: 15, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>{item.name}</Text>
) : (
<View style={{ flexDirection: 'row' }}>
<View >
<Image source={{ uri: item.image }} style={{ height: 100, width: 100, borderRadius: 5, top: 5 }}></Image>
<View style={{ flex: 1, flexDirection: 'row', height: 100 }}>
<View style={{ flex: 1, height: 100 }}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Menu Detail', {nameMenu:item.name,desc:item.description,image:item.image})}>
<Image source={{ uri: item.image }} style={{ height: 100, width: 100, borderRadius: 10, }}></Image>
</TouchableOpacity>
</View>
<View style={{ flex: 2, height: 150 }}>
<View style={{ marginLeft: 5, marginRight: 5 }}>
<Text style={{ fontSize: 15, margin: 5, marginRight: 10, fontFamily: 'Gotham-Black' }}>{item.name}</Text>
<NumberFormat decimalScale={0} value={item.price} renderText={value => <Text style={{ fontSize: 12, margin: 5, marginRight: 10, fontFamily: 'Gotham-Black', color: 'grey' }}>Rp. {value}</Text>} displayType={'text'} thousandSeparator={true} prefix={''} />
</View>
<View style={{ marginLeft: 5, marginRight: 5, flexDirection: 'row' }}>
<View style={styles.shadowEdit}>
<Image source={(require('../assets/icon/icon-pencil.png'))} style={{ height: 25, width: 25, marginLeft: 5, marginRight: 5 }}></Image>
</View>
<View >
<Text style={{ fontSize: 20, margin: 5, marginRight: 10, fontWeight: 'bold' }}>{item.name}</Text>
<Text style={{ fontSize: 15, margin: 5, marginRight: 10 }}>Rp. {item.price}</Text>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={styles.shadowEdit}></View>
<View style={styles.shadowAdd}>
<TouchableOpacity onPress={() => this.props.handleMin()}>
<Text style={{ fontSize: 20, margin: 2 }}> - </Text>
<Text style={{ fontSize:25,alignSelf:'center' }}> - </Text>
</TouchableOpacity>
<TextInput
style={{ height: 25, padding: 2, textAlign: 'center', margin: 2 }}
style={{ padding: 2, textAlign: 'center', fontFamily: 'Gotham-Black',fontSize:15,marginRight:5,marginLeft:5 }}
keyboardType={'numeric'}
onChangeText={(qty) => this.handleChangeQuantity(item, qty)}>{item.qty}</TextInput>
<TouchableOpacity onPress={() => this.props.handleAdd()}>
<Text style={{ fontSize: 20, margin: 2 }}> + </Text>
<TouchableOpacity style={{alignSelf:'center'}} onPress={() => this.props.handleAdd()}>
<Text style={{ fontSize: 25,alignSelf:'center' }}> + </Text>
</TouchableOpacity>
</View>
</View>
......@@ -77,7 +84,7 @@ class Item extends React.Component {
const styles = StyleSheet.create({
shadowEdit: {
height: 30,
width: 25,
width: 40,
borderWidth: 1,
borderRadius: 2,
borderColor: '#ddd',
......@@ -89,11 +96,11 @@ const styles = StyleSheet.create({
elevation: 1,
marginLeft: 5,
marginRight: 5,
marginTop: 10,
marginTop: 5,
},
shadowAdd: {
height: 30,
width: 75,
width: 90,
borderWidth: 1,
borderRadius: 2,
borderColor: '#ddd',
......@@ -105,7 +112,7 @@ const styles = StyleSheet.create({
elevation: 1,
marginLeft: 5,
marginRight: 5,
marginTop: 10,
marginTop: 5,
flexDirection: 'row'
},
shadowMin: {
......@@ -122,7 +129,7 @@ const styles = StyleSheet.create({
elevation: 1,
marginLeft: 5,
marginRight: 5,
marginTop: 10,
marginTop: 5,
}
})
......
......@@ -4,23 +4,22 @@ import Axios from 'axios';
export default function MenuDetail({ route, navigation }) {
const { desc } = route.params;
const { nama } = route.params;
const { Foto } = route.params;
const { nameMenu } = route.params;
const { image } = route.params;
return (
<View style={styles.container}>
<View style={styles.header}>
<Text style={{ textAlign: 'center', margin: 20, fontSize: 25, alignSelf: 'center' }}>{nama}</Text>
</View>
<View style={styles.body}>
{/* <View style={styles.images}> */}
<Image style={{ height: '50%', width: '100%' }}
source={{
uri: Foto
uri: image
}}
/>
{/* </View> */}
<View style={{height:50,justifyContent:'center'}}>
<Text style={{fontFamily:'Gotham-Black',fontSize:25,textAlign:'center',color:'grey'}}>{nameMenu}</Text>
</View>
<View style={{height:1,backgroundColor:'grey',marginRight:15,marginLeft:15,borderWidth:1,borderColor:'grey'}}></View>
<View style={styles.content}>
<Text style={{ margin: 20, textAlign: 'justify' }}>
<Text style={{ fontSize:15, fontFamily:'Gotham-Light',textAlign:'center',marginTop:10 }}>
{desc}
</Text>
</View>
......@@ -35,10 +34,6 @@ const styles = StyleSheet.create({
flex: 1,
backgroundColor: 'white',
},
header: {
flex: 0.5,
},
images: {
margin: 10,
flex: 2,
......
......@@ -39,8 +39,10 @@ class MenuSelection extends React.Component {
})
this._getPermissions()
}
// console.log("INI OUTLET : "+ this.props.outlet_id)
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true
})
if (this.props.outlet_id != '') {
this.getMenuList()
} else {
......@@ -48,6 +50,7 @@ class MenuSelection extends React.Component {
indicator: true
})
this._getPermissions()
}
});
}
......@@ -176,10 +179,9 @@ class MenuSelection extends React.Component {
}
renderTabBar = ({ item }) => {
return (
<View style={{ margin: 10 }}>
<View style={{ flex: 1, height: 270 }}>
<TouchableOpacity>
<Image style={{ height: 50, width: 50, borderRadius: 25 }} source={{ uri: item.image }} />
<Text>{item.name}</Text>
<Image style={{ height: 70, width: 70,top:5}} source={{ uri: item.image }} />
</TouchableOpacity>
</View>
)
......@@ -245,9 +247,9 @@ class MenuSelection extends React.Component {
}
}
onChange(params){
onChange(params) {
console.log(params);
}
}
handleMin(item, index) {
......@@ -278,8 +280,7 @@ class MenuSelection extends React.Component {
return (
<View style={styles.container}>
<StatusBar hidden={true} />
<View style={{ flex: 0.7, height: 90, flexDirection: 'row', borderWidth: 1, }}>
<View style={{ flex:0.5, height: 50, flexDirection: 'row' }}>
<FlatList horizontal={true} style={{ flexDirection: 'row' }}
showsHorizontalScrollIndicator={false}
data={this.state.listCategory}
......@@ -287,12 +288,12 @@ class MenuSelection extends React.Component {
keyExtractor={(item) => item.id}
/>
</View>
<View style={{height:1,backgroundColor:'grey',marginRight:10,marginLeft:10,marginTop:5}}></View>
<View style={{ flex: 3 }}>
{this.state.indicator == true ? (
<ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" />
) : (
<FlatList
data={this.props.menu_item}
renderItem={({ item, index }) => (
<Item navigation={this.props.navigation}
......@@ -305,24 +306,25 @@ class MenuSelection extends React.Component {
/>
)}
</View>
<View style={styles.shadow}>
{
this.state.indicator == true ? (<ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" />) : (
<View>
<View style={{ flexDirection: 'row', }}>
<Text style={{ fontSize: 12, margin: 10 }}> Price Estimation / Item {this.props.order_quantity} </Text>
{this.props.type_pickup == true ? (null) : (
</View>
<View style={styles.shadow}>
<Text style={{ fontSize: 12, margin: 10, fontFamily: 'Gotham-Black' }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : (
<Text style={{ fontSize: 12, margin: 10 }}> Ongkir {this.props.grabamount} </Text>
)}
<Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text>
)} </Text>
<View style={{ flex: 1, flexDirection: 'row' }}>
<View style={{ flex: 1 }}>
<Text style={{ fontSize: 20, margin: 10, marginBottom: 10, fontFamily: 'Gotham-Light' }}> Rp. {this.props.order_total}</Text>
</View>
<View style={{ flex: 1,height:100,marginBottom:30}}>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Shopping Cart')}>
<View style={{ height: 40, borderRadius: 10, backgroundColor: '#CFB368',marginRight:20,flexDirection:'row',marginBottom:30}}>
<Image source={(require('../assets/icon/icon-order.png'))} style={{height:50,width:40,tintColor:'white',}}></Image>
<Text style={{ fontFamily: 'Gotham-Light', color: 'white', fontSize: 15,alignSelf:'center', textAlign: 'center' }}>View Cart</Text>
</View>
</TouchableOpacity>
</View>
)
}
<View>
<Button title="VIEW CART" onPress={() => this.props.navigation.navigate('Shopping Cart')}></Button>
</View>
<View>
</View>
......@@ -348,8 +350,8 @@ const styles = StyleSheet.create({
shadowRadius: 5,
elevation: 1,
marginTop: 10,
flex: 0.8,
height: 80,
flex: 0.5,
height: 50,
}
})
......@@ -400,4 +402,22 @@ const mapDispatchToProps = (dispacth) => {
}
}
export default connect(mapStateToProps, mapDispatchToProps)(MenuSelection)
{/* <Button title="VIEW CART" onPress={() => this.props.navigation.navigate('Shopping Cart')}></Button> */ }
// {
// this.state.indicator == true ? (<ActivityIndicator style={{ top: 10 }} size="large" color="#c9af6d" />) : (
// <View style={{ flexDirection: 'row', }}>
// <Text style={{ fontSize: 12, margin: 10, fontFamily:'Gotham-Black' }}> {this.props.order_quantity} Item | {this.props.type_pickup == true ? (null) : (
// <Text style={{ fontSize: 12, margin: 10 }}> Ongkir {this.props.grabamount} </Text>
// )} </Text>
// <Text style={{ fontSize: 20, margin: 10, marginBottom: 10 }}> Rp. {this.props.order_total}</Text>
// </View>
// )
// }
\ No newline at end of file
......@@ -101,6 +101,7 @@ class PickupName extends React.Component {
Axios.post("https://excelsocrm.ravintoladev.com/crm/v2/outlet/get_list", params).then(res => {
let dataOutlets = res.data.outlets;
console.log("INI ADALAH DATA OUTLETS : "+ JSON.stringify(dataOutlets))
for (let i = 0; i < dataOutlets.length; i++) {
dataOutlets[i]['distance'] = this.distance(dataOutlets[i]['lat'], dataOutlets[i]['long']);
let address = dataOutlets[i]['address'];
......@@ -200,21 +201,21 @@ class PickupName extends React.Component {
<View>
<TouchableOpacity onPress={() => this.getOutletDetail(item.id, item.name)}>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View>
<MaterialCommunityIcons name="map-marker" size={32} color="brown" />
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View>
<View style={styles.list_addrees}>
<View style={{ margin: 5 }}>
<Text style={{ fontWeight: 'bold', fontSize: 20 }}>{item.name}</Text>
<Text style={{ fontWeight: 'bold', fontSize: 15, color: '#ccb46c' }}>OPEN - </Text>
<Text style={{ fontFamily: 'Gotham-Black', color: 'grey', fontSize: 20 }}>{item.name}</Text>
<View style={{flexDirection:'row'}}>
{item.can_accept_order == true ? (<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c",top:5}}>OPEN </Text>)
:(<Text style={{fontFamily: 'Gotham-Black',color:"#ccb46c"}}>CLOSED </Text>) }
</View>
</View>
<Text style={{ margin: 5, color: '#b1b1b2' }}>
<Text style={{ fontFamily: 'Gotham-Light', color: '#CFB368'}}> Opening Hours : {item.open_time} - {item.close_time}</Text>
<Text style={{ margin: 5, color: '#b1b1b2',fontFamily: 'Gotham-Light' }}>
{item.full_address}
</Text>
<Text style={{ margin: 5, color: '#aeaead' }}>
{item.distance} KM
</Text>
</View>
<View>
<CheckBox
......@@ -222,8 +223,10 @@ class PickupName extends React.Component {
checkedIcon='dot-circle-o'
uncheckedIcon='circle-o'
checked={this.state.checked}
checkedColor="#ccb46c"
uncheckedColor="#ccb46c"
/>
<Text style={{textAlign:'center',color:'#ccb46c',fontFamily:'Gotham-Light' }}>{item.distance} KM</Text>
</View>
</View>
</TouchableOpacity>
......@@ -242,7 +245,7 @@ class PickupName extends React.Component {
<View style={styles.searchbar}>
<View style={{ height: 45, borderRadius: 10, borderColor: '#ccb46c', borderWidth: 1, flexDirection: 'row' }}>
<View style={{ flex: 1 }}>
<MaterialCommunityIcons name="map-marker" size={32} color="brown" />
<MaterialCommunityIcons name="map-marker" size={32} color="#ccb46c" />
</View>
<View style={{ flex: 6 }}>
<TextInput style={{ height: 45 }} placeholder="Cari lokasi Pickup Store"
......@@ -251,10 +254,9 @@ class PickupName extends React.Component {
value={this.state.search}></TextInput>
</View>
<View style={{ flex: 1, margin: 5 }}>
<Ionicons name="ios-search" size={32} color="brown" />
<Ionicons name="ios-search" size={32} color="#ccb46c" />
</View>
</View>
</View>
<View style={styles.body}>
<FlatList
......
......@@ -97,46 +97,53 @@ class RewardDetail extends React.Component {
<View style={styles.container}>
<ScrollView>
<View style={styles.images}>
<Image style={{ height: 250 ,width:'100%' }} source={this.state.image ? { uri: this.state.image } : null} />
<Image style={{ height: 250, width: '100%' }} source={this.state.image ? { uri: this.state.image } : null} />
<View style={styles.voucher_code}>
<Text style={styles.text_voucher}>Voucher Code : </Text>
<Text style={styles.text_c_voucher}>{this.state.code}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 18, textAlign: 'center', marginBottom: 5, top: 15 }}>{this.state.code}</Text>
</View>
<View style={styles.expire_time}>
<Text style={styles.text_expire}>Expire Time : </Text>
<Text style={styles.text_c_expire}>{this.state.expire}</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', marginBottom: 5, top: 7 }}>{this.state.expire}</Text>
</View>
</View>
<View style={styles.content}>
<View style={{ marginRight: 5, marginLeft: 5 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 15 }}>{this.state.title}</Text>
</View>
<View style={{ marginRight: 20, marginLeft: 20 }}>
<HTML html={this.state.content} />
</View>
</View>
<View style={styles.content}>
{this.state.cur_time >= this.state.exp_time ? (<Button
style={{ margin: 5 }}
title="EXPIRED"
onPress={() => console.log('inin')}
buttonStyle={{ height: 50, backgroundColor: 'red' }}
/>)
{this.state.cur_time >= this.state.exp_time ? (
<View style={{ flex: 1, height: 50, marginRight: 70, marginLeft: 70, justifyContent: 'center' }}>
<TouchableOpacity>
<View style={{ height: 50, borderRadius: 20, backgroundColor: 'red' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>EXPIRED</Text>
</View>
</TouchableOpacity>
</View>
)
: this.state.used == 0 ? (
<Button
style={{ margin: 5 }}
title="USE VOUCHER"
onPress={() => this.useVoucher()}
buttonStyle={{ height: 50, backgroundColor: '#2ead28' }}
/>
<View style={{ flex: 1, height: 50, marginRight: 70, marginLeft: 70, justifyContent: 'center' }}>
<TouchableOpacity onPress={() => this.useVoucher()}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>USE VOUCHER</Text>
</View>
</TouchableOpacity>
</View>
) : (
<Button
style={{ margin: 5 }}
title="USED"
onPress={() => this.useDVoucher()}
buttonStyle={{ height: 50, backgroundColor: '#2ead28' }}
/>
<TouchableOpacity onPress={() => this.useDVoucher()}>
<View style={{ height: 50, borderRadius: 20, backgroundColor: '#CFB368' }}>
<Text style={{ fontFamily: 'Gotham-Black', color: 'white', fontSize: 20, textAlign: 'center', margin: 15 }}>USED VOUCHER</Text>
</View>
</TouchableOpacity>
)}
</View>
<View style={styles.content}>
<View style={{ margin: 10 }}>
<HTML html={this.state.content} />
</View>
</View>
</ScrollView>
</View>
)
......@@ -155,32 +162,36 @@ const styles = StyleSheet.create({
},
voucher_code: {
fontFamily: 'Gotham-Black',
height: 70,
marginLeft: 20,
marginRight: 20,
backgroundColor: '#01919c',
flex: 1,
marginTop:-140
marginTop: -140
},
expire_time: {
fontFamily: 'Gotham-Black',
flex: 1,
marginLeft: 20,
marginRight: 20,
height: 70,
justifyContent:'center',
backgroundColor: 'black',
},
text_voucher: {
fontFamily: 'Gotham-Black',
fontSize: 14,
marginLeft: 10,
top:5,
color: 'white'
},
text_c_voucher: {
fontFamily: 'Gotham-Black',
textAlign: 'center',
fontWeight: 'bold',
fontSize: 30,
......@@ -189,6 +200,7 @@ const styles = StyleSheet.create({
},
text_expire: {
fontFamily: 'Gotham-Black',
fontSize: 15,
marginLeft: 10,
top: 5,
......@@ -196,16 +208,18 @@ const styles = StyleSheet.create({
},
text_c_expire: {
fontFamily: 'Gotham-Black',
textAlign: 'center',
fontWeight: 'bold',
fontSize: 30,
top: 5,
color: 'white'
color: 'white',
},
content: {
flex: 1,
marginBottom: 20,
},
button: {
flex: 1,
......
......@@ -99,7 +99,7 @@ class RewardSelect extends React.Component {
resizeMode='cover'
style={{ height: 100, width: '100%' }} />
</View>
<View style={{ flexDirection: 'row', justifyContent:'space-between', padding:10 }}>
<View style={{ flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View>
<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>
......
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