Commit ad48184d authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo
parents b4689c55 7d607d25
......@@ -15,7 +15,16 @@ import React, { useState, useEffect } from 'react';
import { Text, View } from 'react-native';
import { AppLoading } from 'expo';
import * as Font from 'expo-font';
import * as Sentry from 'sentry-expo';
import Constants from 'expo-constants';
Sentry.init({
dsn: 'https://ae2449ac801244d99f170140c7cd6d0a@o392471.ingest.sentry.io/5239999',
enableInExpoDevelopment: true,
debug: true,
});
Sentry.setRelease(Constants.manifest.revisionId);
export const lang = i18n.translations = {
en: en,
......
......@@ -32,6 +32,19 @@
"package": "local.ravExcelso",
"versionCode": 20200327
},
"description": ""
"description": "",
"hooks": {
"postPublish": [
{
"file": "sentry-expo/upload-sourcemaps",
"config": {
"organization": "ravintola",
"project": "ravintola",
"authToken": "5a140e31fb884af58c7d9e20e8baa5ddc8fee9ac79ba427786da245b3015f6d3",
"url": "your sentry url here" // OPTIONAL- only necessary when self-hosting Sentry
}
}
]
}
}
}
......@@ -70,7 +70,8 @@
"react-redux-i18n": "^1.9.3",
"redux": "^4.0.5",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0"
"redux-thunk": "^2.3.0",
"sentry-expo": "^2.0.4"
},
"devDependencies": {
"babel-preset-expo": "~8.0.0",
......
import * as React from 'react';
import { View, Text, StyleSheet, ScrollView, TouchableOpacity, Alert, ActivityIndicator } from 'react-native';
import { Ionicons, MaterialCommunityIcons, SimpleLineIcons } from '@expo/vector-icons';
import { SliderBox } from "react-native-image-slider-box";
import { Card } from 'react-native-shadow-cards';
import { connect } from 'react-redux';
......@@ -36,7 +37,7 @@ class Home extends React.Component {
}
componentDidMount() {
console.log("INI BUILD VERSION : "+ Constants.nativeBuildVersio)
console.log("INI BUILD VERSION : " + Constants.nativeBuildVersio)
this._account();
this._getPermissions()
this._renderCarousell()
......@@ -44,7 +45,7 @@ class Home extends React.Component {
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator:true,
indicator: true,
})
this._account();
this._getPermissions()
......@@ -132,9 +133,9 @@ class Home extends React.Component {
indicator: false
})
}).catch(error => {
const {navigation} = this.props
const { navigation } = this.props
let response = error.response.data
session(response,navigation)
session(response, navigation)
Alert.alert(response.msg);
})
}
......@@ -161,19 +162,19 @@ class Home extends React.Component {
indicator: false
})
}).catch(error => {
const {navigation} = this.props
const { navigation } = this.props
let response = error.response.data
session(response,navigation)
session(response, navigation)
Alert.alert(response.msg);
})
}
_pickup() {
this.props.navigation.navigate('Pickup Name', {from : 'home'});
this.props.navigation.navigate('Pickup Name', { from: 'home' });
}
_delivery(){
this.props.navigation.navigate('Delivery Address', {from : 'home'});
_delivery() {
this.props.navigation.navigate('Delivery Address', { from: 'home' });
}
_orderNow = () => {
......@@ -196,6 +197,18 @@ class Home extends React.Component {
<View style={styles.container}>
<ScrollView>
<View style={{ flex: 6 }}>
<View style={styles.header}>
{/* <StatusBar barStyle='dark-content' /> */}
{/* <Text style={styles.titleText}>{i18n.t('register')}</Text> */}
<View style={{ flex: 1, alignItems: 'flex-end' }}>
<Text style={styles.titleText}>TODAY PROMOTIONS</Text>
</View>
<View style={{ margin: 15, flex: 0.15, alignItems: 'flex-end' }}>
<TouchableOpacity>
<SimpleLineIcons name="bell" size={24} color="white" />
</TouchableOpacity>
</View>
</View>
<SliderBox
images={this.state.images}
autoplay
......@@ -233,15 +246,24 @@ class Home extends React.Component {
<View style={styles.card}>
<Card>
<View style={{ flexDirection: 'row', justifyContent: 'center' }}>
<TouchableOpacity style={styles.buttonDelivery} onPress={() => this._delivery() }>
{/* <TouchableOpacity style={styles.buttonDelivery} onPress={() => this._delivery()}>
<Text style={{ textAlign: 'center', color: '#354175', fontWeight: 'bold' }}>{i18n.t('delivery')}</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonPickup} onPress={() => this._pickup()}>
<Text style={{ textAlign: 'center', color: '#fff', fontWeight: 'bold' }}>{i18n.t('pickup')}</Text>
</TouchableOpacity> */}
<TouchableOpacity style={styles.buttonDelivery} onPress={() => this._delivery()}>
<Text style={{ textAlign: 'center', color: '#354175', fontWeight: 'bold' }}>DELIVERY</Text>
</TouchableOpacity>
<TouchableOpacity style={styles.buttonPickup} onPress={() => this._pickup()}>
<Text style={{ textAlign: 'center', color: '#fff', fontWeight: 'bold' }}>PICK UP</Text>
</TouchableOpacity>
</View>
<Text style={{ textAlign: 'center', fontSize: 12, }}>
{/* <Text style={{ textAlign: 'center', fontSize: 12, }}>
{i18n.t('orderInfo')}
</Text> */}
<Text style={{ textAlign: 'center', fontSize: 12, }}>
YOU WILL PICKUP YOUR ORDER AT
</Text>
{this.state.indicator == true ? (
<ActivityIndicator size="small" color="#c9af6d" />
......@@ -250,8 +272,11 @@ class Home extends React.Component {
Excelso {this.props.name_outlet}
</Text>
)}
<TouchableOpacity style={styles.submitOrder} activeOpacity={.5} onPress={() => this._orderNow()}>
{/* <TouchableOpacity style={styles.submitOrder} activeOpacity={.5} onPress={() => this._orderNow()}>
<Text style={{ textAlign: 'center', bottom: 5, color: 'white' }}>{i18n.t('orderNow')}</Text>
</TouchableOpacity> */}
<TouchableOpacity style={styles.submitOrder} activeOpacity={.5} onPress={() => this._orderNow()}>
<Text style={{ textAlign: 'center', bottom: 5, color: 'white' }}>ORDER NOW</Text>
</TouchableOpacity>
</Card>
{
......@@ -278,21 +303,49 @@ class Home extends React.Component {
(
<View style={styles.card}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
<Text>
<Card style={{ padding: 20, margin: 10, alignContent: 'center' }}>
{/* <Text>
{i18n.t('yourCardNumber')} | {this.state.expire_date}{'\n'}
</Text> */}
<Text>
YOUR CARD NUMBER | {this.state.expire_date}
</Text>
<Text style={{ textAlign: "center", fontSize: 40, color: '#c9af6d' }}>
<View style={{ paddingHorizontal: 10 }}>
<Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d' }}>
{this.state.account_number}
</Text>
</View>
<View style={styles.line}></View>
<Text style={{ textAlign: 'left', fontWeight: 'bold' }}> {'\n'}
{i18n.t('balance')} {this.state.balance}{'\n'}
</Text>
<View style={styles.line}></View>
<Text style={{ textAlign: 'left', fontWeight: 'bold' }}>{'\n'}
{/* <Text style={{ textAlign: 'left', fontWeight: 'bold' }}>
{i18n.t('balance')} {this.state.balance}
</Text> */}
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 10 }}>BALANCE</Text>
</View>
<View style={{ flex: 0.7 }}>
<Text style={{ fontSize: 20 }}>IDR. {this.state.balance}</Text>
</View>
</View>
<View style={styles.line2}></View>
{/* <Text style={{ textAlign: 'left', fontWeight: 'bold' }}>
{i18n.t('point')} {this.state.point}
</Text>
</Text> */}
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 10 }}>POINTS</Text>
</View>
<View style={{ flex: 0.7 }}>
<Text style={{ fontSize: 20 }}>IDR. {this.state.point}</Text>
</View>
</View>
</Card>
</View>
)
......@@ -317,6 +370,20 @@ const styles = StyleSheet.create({
flex: 1,
backgroundColor: 'white',
},
header: {
flex: 0.1,
flexDirection: 'row',
backgroundColor: '#CFB368',
// justifyContent: 'space-between',
// alignItems: 'center'
},
titleText: {
margin: 15,
fontSize: 18,
fontWeight: 'bold',
color: 'white',
// textAlign: 'center'
},
content: {
flex: 1,
......@@ -378,7 +445,15 @@ const styles = StyleSheet.create({
line: {
borderBottomColor: '#c9af6d',
borderBottomWidth: StyleSheet.hairlineWidth,
borderBottomWidth: 2,
alignSelf: 'stretch',
width: "100%",
height: 10,
bottom: 5,
},
line2: {
borderBottomColor: '#c9af6d',
borderBottomWidth: 1,
alignSelf: 'stretch',
width: "100%",
height: 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