Commit 742cdd41 authored by Trisno's avatar Trisno
parents deaba70b 2719898f
import * as React from 'react';
import Auth from './view/Auth';
import { NavigationContainer } from '@react-navigation/native';
import { persistStore, persistReducer } from 'redux-persist';
......@@ -11,15 +11,19 @@ import * as Localization from 'expo-localization';
import i18n from 'i18n-js';
import en from './lib/en';
import id from './lib/id';
import React, { useState, useEffect } from 'react';
import { Text, View } from 'react-native';
import { AppLoading } from 'expo';
import * as Font from 'expo-font';
export const lang = i18n.translations = {
en:en,
id:id
}
export const set_lang = i18n.locale = Localization.locale;
export const fallbacks = i18n.fallbacks = true;
export const lang = i18n.translations = {
en: en,
id: id
}
export const set_lang = i18n.locale = Localization.locale;
export const fallbacks = i18n.fallbacks = true;
const persistConfig = {
key: 'root',
......@@ -30,14 +34,39 @@ const persistReducers = persistReducer(persistConfig, rootReducer)
const store = createStore(persistReducers);
const persistor = persistStore(store)
i18n.locale = Localization.locale;
let customFonts = {
'Gotham-Black': require('./assets/font/Gotham-Bold-700.otf'),
'Gotham-SemiBoldItalic': require('./assets/font/Gotham-BoldItalic-400.otf'),
'Gotham-Thin': require('./assets/font/iCiel-Gotham-Thin.ttf'),
'Gotham-Light': require('./assets/font/Metropolis-Light.otf'),
};
export default function App() {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<NavigationContainer>
<Auth />
</NavigationContainer>
</PersistGate>
</Provider>
);
const [fontsLoaded, setfontsLoaded] = useState(false)
const loadFont = async () => {
await Font.loadAsync(customFonts);
};
useEffect(() => {
console.log('===> Did Mount');
loadFont().then(_ => {
setfontsLoaded(true);
})
}, [])
if (!fontsLoaded) {
return <AppLoading />;
} else {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<NavigationContainer>
<Auth />
</NavigationContainer>
</PersistGate>
</Provider>
);
}
}
{
"expo": {
"name": "Excelso_update v1. 13.05.2020",
"name": "Excelso_update v1. siang.13.05.2020",
"slug": "excelso-pro",
"privacy": "public",
"sdkVersion": "36.0.0",
......
This diff is collapsed.
......@@ -1409,6 +1409,11 @@
"prop-types": "^15.6.1"
}
},
"@use-expo/font": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@use-expo/font/-/font-2.0.0.tgz",
"integrity": "sha512-oOJ2uaRyZNQg7PnQviz7nBcdrRL38zxScab4ktgtI4asa6G0dHW9wg307uJJmn0sHS04Yqtw+m0EOjDcGw3iWg=="
},
"@valdio/react-native-scrollable-tabview": {
"version": "0.8.12",
"resolved": "https://registry.npmjs.org/@valdio/react-native-scrollable-tabview/-/react-native-scrollable-tabview-0.8.12.tgz",
......@@ -6278,9 +6283,9 @@
}
},
"react-native-device-info": {
"version": "5.5.3",
"resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-5.5.3.tgz",
"integrity": "sha512-bzUVTPHca+FfNco1qaOM1+idoeII8zdpGRsR+RK+DWhwp9utHZWfbkonZZ9XFm/U+i3mirNxt6oaKV+vUMjMzg=="
"version": "5.5.7",
"resolved": "https://registry.npmjs.org/react-native-device-info/-/react-native-device-info-5.5.7.tgz",
"integrity": "sha512-0021blhx/N1+mWQPOW3QAMWhOjYdG0uC5n+P6sMXZD3pF9aiIeCKuw4JpBpfNXXpUmDmQ7qWgHZUZO7JBMRijw=="
},
"react-native-drawer": {
"version": "2.5.1",
......
......@@ -14,6 +14,7 @@
"@react-navigation/native": "^5.0.5",
"@react-navigation/stack": "^5.0.5",
"@shankarmorwal/rn-viewpager": "^1.2.11",
"@use-expo/font": "^2.0.0",
"@valdio/react-native-scrollable-tabview": "^0.8.12",
"accordion-collapse-react-native": "^0.2.8",
"axios": "^0.19.2",
......@@ -39,7 +40,7 @@
"react-native-check-box": "^2.1.7",
"react-native-date-picker": "^2.7.7",
"react-native-datepicker": "^1.7.2",
"react-native-device-info": "^5.5.3",
"react-native-device-info": "^5.5.7",
"react-native-elements": "^1.2.7",
"react-native-form-select-picker": "0.0.7",
"react-native-fs": "^2.16.6",
......@@ -75,5 +76,6 @@
"babel-preset-expo": "~8.0.0",
"@babel/core": "^7.0.0"
},
"private": true
}
......@@ -56,10 +56,10 @@ enableScreens();
const Tab = createBottomTabNavigator();
function HomePage({navigation}) {
function HomePage({ navigation }) {
return (
<Tab.Navigator
screenOptions={({ route }) => ({
tabBarIcon: ({ focused, color, size }) => {
let iconName;
......@@ -88,7 +88,7 @@ function HomePage({navigation}) {
tabBarOptions={{ activeTintColor: 'cornflowerblue', inactiveTintColor: 'gray' }}
>
<Tab.Screen name="HOME" component={Home} />
<Tab.Screen name="HOME" component={Home} />
<Tab.Screen name="MENU" component={MenuSelection} />
<Tab.Screen name="REWARDS" component={RewardsList} />
<Tab.Screen name="ORDER" component={OrderHistory} />
......@@ -113,7 +113,7 @@ class Auth extends React.Component {
this.props.session_id === '' ? (
<>
{/* <Stack.Screen name="Change language" component={ChangeLanguage} /> */}
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Login" component={Login} options={{ headerShown: false }} />
<Stack.Screen name="Home" component={Home} />
<Stack.Screen name="Profile" component={ProfilePage} />
<Stack.Screen name="Change Profil" component={ChangeProfile} />
......@@ -124,11 +124,24 @@ class Auth extends React.Component {
<>
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} />
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Home" component={Home} options={{headerShown:false}} />
<Stack.Screen name="Home" component={Home} options={{ headerShown: false }} />
</>
) : (
<>
<Stack.Screen name="Home" component={HomePage} options={{headerShown:false}}/>
<Stack.Screen name="Home" component={HomePage}
options={{
headerShown: false,
title: 'TODAY PROMOTION',
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle:{alignContent:'center'},
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
color:'white',
textAlign:'center'
}
}} />
<Stack.Screen name="Profile" component={ProfilePage} />
<Stack.Screen name="Change Profil" component={ChangeProfile} />
<Stack.Screen name="Change language" component={ChangeLanguage} />
......@@ -136,26 +149,27 @@ class Auth extends React.Component {
<Stack.Screen name="Card Activation" component={CardActivation} />
<Stack.Screen name="Renewal" component={Renewal} />
<Stack.Screen name="Account" component={Account} />
<Stack.Screen name="Login" component={Login} />
<Stack.Screen name="Login" component={Login} options={{ headerShown: false }} />
<Stack.Screen name="Transfer Balance" component={TransferBalance} />
<Stack.Screen name="Register" component={Register} />
<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="Delivery Address" component={DeliveryAddress} />
<Stack.Screen name="Address Detail" component={AddressDetail} />
<Stack.Screen name="Menu Detail" component={MenuDetail} />
<Stack.Screen name="Pickup Name" component={PickupName} options={{title:"PICKUP STORE",headerStyle:{backgroundColor:"#ccb46c"},headerTitleAlign:'center',headerTitleStyle:{color:'white',fontWeight:'bold'}}} />
<Stack.Screen name="Outlet Detail" component={OutletDetail}/>
<Stack.Screen name="Menu Select" component={MenuSelection} options={{headerShown:false}} />
<Stack.Screen name="Pickup Name" component={PickupName} options={{ title: "PICKUP STORE", headerStyle: { backgroundColor: "#ccb46c" }, headerTitleAlign: 'center', headerTitleStyle: { color: 'white', fontWeight: 'bold' } }} />
<Stack.Screen name="Outlet Detail" component={OutletDetail} />
<Stack.Screen name="Menu Select" component={MenuSelection} options={{ headerShown: false }} />
<Stack.Screen name="Card Info" component={CardInfo} />
<Stack.Screen name="Shopping Cart" component={ShoppingCart} />
<Stack.Screen name="Order History" component={OrderHistory} />
<Stack.Screen name="Reward History" component={RewardHistory} />
<Stack.Screen name="Order Detail" component={OrderDetail} options={({ navigation, route }) => ({ headerLeft: props => <HeaderBackButton {...props} onPress={()=>navigation.navigate('Home',{screen:'ORDER'})}/>,
})}/>
<Stack.Screen name="Order Detail" component={OrderDetail} options={({ navigation, route }) => ({
headerLeft: props => <HeaderBackButton {...props} onPress={() => navigation.navigate('Home', { screen: 'ORDER' })} />,
})} />
</>
)
......@@ -177,10 +191,10 @@ class Auth extends React.Component {
<Stack.Screen name="News Detail" component={NewsDetail} />
{/* <Stack.Screen name="Delivery Address" component={DeliveryAddress} /> */}
<Stack.Screen name="Confirm Your Order" component={MenuConfirmation} />
{/* <Stack.Screen name="Card Info" component={CardInfo} /> */}
{/* <Stack.Screen name="Change password" component={ChangePassword} /> */}
......
......@@ -12,8 +12,13 @@ import * as Permissions from 'expo-permissions';
import * as Device from 'expo-device';
import ActionType from '../redux/globalActionType';
import session from '../function/session';
import Constants from 'expo-constants';
import info from '../app.json';
let version = info.expo.version
let buildNumber = info.expo.android.versionCode
class Home extends React.Component {
constructor(props) {
......@@ -31,6 +36,7 @@ class Home extends React.Component {
}
componentDidMount() {
console.log("INI BUILD VERSION : "+ Constants.nativeBuildVersio)
this._account();
this._getPermissions()
this._renderCarousell()
......@@ -294,7 +300,9 @@ class Home extends React.Component {
<TouchableOpacity style={styles.submitUpgradePemium} activeOpacity={.5} onPress={this.onPress}>
<Text style={{ textAlign: 'center', bottom: 5, color: 'white' }}>TOP BALANCE </Text>
</TouchableOpacity>
<Text> 13 May 2020 </Text>
<Text> App version : {version} </Text>
<Text> Expo build version : {buildNumber} </Text>
<View style={{ height: 60 }}></View>
</View>
</View>
......
This diff is collapsed.
......@@ -80,7 +80,7 @@ class RewardsList extends React.Component {
</TouchableOpacity>
))
}
<TouchableOpacity>
<TouchableOpacity onPress={()=> this.props.navigation.navigate('Reward History')}>
<Text style={{ textAlign: 'right', color: '#ccb46c' }}>REDEEM E-VOUCHER HISTORY</Text>
</TouchableOpacity>
</ScrollView>
......
......@@ -43,8 +43,9 @@ class ShoppingCart extends React.Component {
componentDidMount() {
console.log(this.props.voucher)
console.log('INI VALUE : ' + this.props.value_voucher)
// console.log(this.props.voucher)
// console.log('INI VALUE : ' + this.props.value_voucher)
if (!this.props.type_pickup) {
this.getRate()
}
......@@ -396,7 +397,7 @@ class ShoppingCart extends React.Component {
kasproPoint: kaspro_point.replace(/,/g, '')
})
// console.log(this.state.kasproBalance, this.state.kasproPoint)
console.log(this.state.kasproBalance, this.state.kasproPoint)
}).catch(error => {
const { navigation } = this.props
let response = error.response.data
......
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