Commit 189f580d authored by Fred's avatar Fred

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

# Conflicts:
#	view/Outlets.js
parents 39002021 75aab192
import Axios from 'axios';
import Constants from 'expo-constants';
import { Alert } from 'react-native';
export default function CheckVersion(navigation) {
let version = Constants.manifest.version
Axios.get('https://excelsocrm.ravintoladev.com/cms/v2/detail/apps-version').then(respon => {
let version_server = respon.data.content5
let msg_res = respon.data.content6
if (version_server !== '2.0.1') {
Alert.alert(
'Update Version',
msg_res,
[
{
text: 'Cancel',
onPress: () => console.log('Cancel Pressed'),
style: 'cancel'
},
{ text: 'OK', onPress: () => navigation.navigate('UpdateVersion') }
],
{ cancelable: false }
);
}
}).catch(error => {
console.log(error)
})
}
\ No newline at end of file
......@@ -9,7 +9,8 @@ import {
TouchableOpacity,
Alert,
Button,
ImageBackground
ImageBackground,
ActivityIndicator
} from 'react-native';
import { StackActions } from '@react-navigation/native';
......@@ -41,7 +42,8 @@ class Account extends React.Component {
premium: "",
my_lat: 0,
my_long: 0,
full_name: ''
full_name: '',
indicator: true
}
}
......@@ -49,6 +51,9 @@ class Account extends React.Component {
this._getProfile()
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true
})
this._getProfile()
});
}
......@@ -144,7 +149,8 @@ class Account extends React.Component {
img_card: img_card,
expire_date: expire,
premium: premium,
full_name: full_name
full_name: full_name,
indicator: false
})
}).catch(error => {
......@@ -182,12 +188,23 @@ class Account extends React.Component {
}
handleSettings() {
if (this.state.clickSettings == 8) {
this.props.navigation.navigate('SettingsScreen')
this.setState({ clickSettings: 0 })
} else {
new_count = this.state.clickSettings
this.setState({ clickSettings: new_count + 1 })
}
}
render() {
const navigation = this.props.navigation
return (
<View style={styles.container}>
<ScrollView>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')}>
<View style={{ flex: 1, height: 90 }}>
<View style={{ alignSelf: 'center' }}>
<Image
......@@ -200,10 +217,11 @@ class Account extends React.Component {
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center' }}>
{this.state.full_name}
</Text>
<TouchableOpacity onPress={() => this.props.navigation.navigate('Profile')}>
<Text style={{ fontFamily: 'Gotham-Light', color: '#838383', fontSize: 12, textAlign: 'center', top: 2 }}>View Profile</Text>
</TouchableOpacity>
</View>
</View>
</TouchableOpacity>
{
this.props.set_card === false ? (
......@@ -239,47 +257,51 @@ class Account extends React.Component {
<View style={styles.Card}>
<View style={styles.card}>
<View style={styles.card}>
<Card style={{ padding: 20, alignContent: 'center' }}>
<View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}>
<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>YOUR CARD NUMBER</Text>
</View>
<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>Expired At {this.state.expire_date}</Text>
</View>
</View>
<View style={{ paddingHorizontal: 10 }}>
<Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>
{this.state.account_number}
</Text>
</View>
<View style={styles.line}></View>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>BALANCE</Text>
</View>
<View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>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> */}
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>POINTS</Text>
</View>
<View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.points}</Text>
</View>
</View>
</Card>
{
this.state.indicator ? (
<Card style={{ padding: 50, alignContent: 'center' }}>
<ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />
</Card>
) : (
<Card style={{ padding: 20, alignContent: 'center' }}>
<View style={{ flexDirection: 'row', flex: 1, paddingBottom: 5 }}>
<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, fontFamily: 'Gotham-Light' }}>YOUR CARD NUMBER</Text>
</View>
<View style={{ flex: 0.5 }}>
<Text style={{ fontSize: 10, textAlign: 'right', fontFamily: 'Gotham-Light' }}>Expired At {this.state.expire_date}</Text>
</View>
</View>
<View style={{ paddingHorizontal: 10 }}>
<Text style={{ textAlign: "center", fontSize: 30, color: '#c9af6d', fontFamily: 'Gotham-Black' }}>
{this.state.account_number}
</Text>
</View>
<View style={styles.line}></View>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>BALANCE</Text>
</View>
<View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.balance}</Text>
</View>
</View>
<View style={styles.line2}></View>
<View style={{ flexDirection: 'row', flex: 1 }}>
<View style={{ flex: 0.3, justifyContent: 'center' }}>
{/* <Text>{i18n.t('balance')}</Text> */}
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Light' }}>POINTS</Text>
</View>
<View style={{ flex: 0.7, alignItems: 'center' }}>
<Text style={{ fontSize: 14, fontFamily: 'Gotham-Black', color: 'gray' }}>IDR {this.state.points}</Text>
</View>
</View>
</Card>
)
}
</View>
</View>
</View>
......@@ -381,8 +403,8 @@ class Account extends React.Component {
{Platform.OS === 'ios' ? (
<Text style={{ color: 'grey', fontSize: 12, textAlign: 'center' }}>Version {Constants.manifest.version} Build {Constants.manifest.ios.buildNumber}</Text>
) : (
<Text style={{ color: 'grey', fontSize: 12, textAlign: 'center' }}>Version {Constants.manifest.version} Build {Constants.manifest.android.versionCode}</Text>
)}
<Text style={{ color: 'grey', fontSize: 12, textAlign: 'center' }}>Version {Constants.manifest.version} Build {Constants.manifest.android.versionCode}</Text>
)}
</View>
</ScrollView>
......
......@@ -55,6 +55,7 @@ import WelcomeLog from './WelcomeLog';
import RatingOrder from './RatingOrder';
import UseBalance from './UseBalance';
import PaymentCode from './PaymentCode';
import UpdateVersion from './UpdateVersion';
enableScreens();
......@@ -70,8 +71,8 @@ const BottomNavigation = ({ state, descriptors, navigation }) => {
options.tabBarLabel !== undefined
? options.tabBarLabel
: options.title !== undefined
? options.title
: route.name;
? options.title
: route.name;
const isFocused = state.index === index;
......@@ -93,7 +94,7 @@ const BottomNavigation = ({ state, descriptors, navigation }) => {
target: route.key,
});
};
let icon = require('../assets/icon/icon-home.png')
if (label === 'HOME') {
icon = require('../assets/icon/icon-home.png')
......@@ -118,11 +119,11 @@ const BottomNavigation = ({ state, descriptors, navigation }) => {
testID={options.tabBarTestID}
onPress={onPress}
onLongPress={onLongPress}
style={{ flex: 1, alignItems: 'center', backgroundColor: 'white', borderTopWidth:1, borderTopColor: '#f0f0f0' }}
style={{ flex: 1, alignItems: 'center', backgroundColor: 'white', borderTopWidth: 1, borderTopColor: '#f0f0f0' }}
>
<Image source={icon} style={{ height: 50, width: 50, tintColor: isFocused ? '#CFB368' : 'gray'}} />
<Image source={icon} style={{ height: 50, width: 50, tintColor: isFocused ? '#CFB368' : 'gray' }} />
</TouchableOpacity>
);
})}
......@@ -130,72 +131,72 @@ const BottomNavigation = ({ state, descriptors, navigation }) => {
)
}
function HomePage({navigation}) {
function HomePage({ navigation }) {
return (
<Tab.Navigator tabBar={props => <BottomNavigation {...props}/>}
// screenOptions={({ route }) => ({
// tabBarIcon: ({ focused, color, size }) => {
// let iconName;
// if (route.name === 'HOME') {
// iconName = focused ? 'ios-home' : 'ios-home'
// } else if (route.name === 'MENU') {
// iconName = focused ? 'ios-paper' : 'ios-paper';
// } else if (route.name === 'REWARDS') {
// iconName = focused ? 'ios-gift' : 'ios-gift';
// } else if (route.name === 'ORDER') {
// iconName = focused ? 'md-cart' : 'md-cart';
// } else if (route.name === 'OUTLETS') {
// iconName = focused ? 'ios-cafe' : 'ios-cafe';
// } else if (route.name === 'ACCOUNT') {
// iconName = focused ? 'account' : 'account';
// return <MaterialCommunityIcons name={iconName} size={size} color={color} />
// }
// // You can return any component that you like here!
// return <Ionicons name={iconName} size={size} color={color} />;
// },
// })}
// screenOptions={({ route }) => ({
// tabBarIcon: ({ focused, color, size }) => {
// let iconName;
// console.log('name', route.name)
// console.log('focused', focused)
// console.log('color', color)
// console.log('size', size)
// // console.log('nav', navigation)
// if (route.name === 'HOME') {
// // iconName = focused ? 'ios-home' : 'ios-home'
// return <Image source={require('../assets/icon/icon-home.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// } else if (route.name === 'MENU') {
// // iconName = focused ? 'ios-paper' : 'ios-paper';
// return <Image source={require('../assets/icon/icon-menu.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// } else if (route.name === 'REWARDS') {
// // iconName = focused ? 'ios-gift' : 'ios-gift';
// return <Image source={require('../assets/icon/icon-rewards.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// } else if (route.name === 'ORDER') {
// // iconName = focused ? 'md-cart' : 'md-cart';
// return <Image source={require('../assets/icon/icon-order.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// } else if (route.name === 'OUTLETS') {
// // iconName = focused ? 'ios-cafe' : 'ios-cafe';
// return <Image source={require('../assets/icon/icon-outlets.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// } else if (route.name === 'ACCOUNT') {
// // iconName = focused ? 'account' : 'account';
// return <Image source={require('../assets/icon/icon-account.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// }
// // You can return any component that you like here!
// return <Ionicons name={iconName} size={size} color={color} />;
// },
// })}
// tabBarOptions={{ activeTintColor: '#CFB368', inactiveTintColor: 'gray', showLabel: false }}
<Tab.Navigator tabBar={props => <BottomNavigation {...props} />}
// screenOptions={({ route }) => ({
// tabBarIcon: ({ focused, color, size }) => {
// let iconName;
// if (route.name === 'HOME') {
// iconName = focused ? 'ios-home' : 'ios-home'
// } else if (route.name === 'MENU') {
// iconName = focused ? 'ios-paper' : 'ios-paper';
// } else if (route.name === 'REWARDS') {
// iconName = focused ? 'ios-gift' : 'ios-gift';
// } else if (route.name === 'ORDER') {
// iconName = focused ? 'md-cart' : 'md-cart';
// } else if (route.name === 'OUTLETS') {
// iconName = focused ? 'ios-cafe' : 'ios-cafe';
// } else if (route.name === 'ACCOUNT') {
// iconName = focused ? 'account' : 'account';
// return <MaterialCommunityIcons name={iconName} size={size} color={color} />
// }
// // You can return any component that you like here!
// return <Ionicons name={iconName} size={size} color={color} />;
// },
// })}
// screenOptions={({ route }) => ({
// tabBarIcon: ({ focused, color, size }) => {
// let iconName;
// console.log('name', route.name)
// console.log('focused', focused)
// console.log('color', color)
// console.log('size', size)
// // console.log('nav', navigation)
// if (route.name === 'HOME') {
// // iconName = focused ? 'ios-home' : 'ios-home'
// return <Image source={require('../assets/icon/icon-home.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// } else if (route.name === 'MENU') {
// // iconName = focused ? 'ios-paper' : 'ios-paper';
// return <Image source={require('../assets/icon/icon-menu.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// } else if (route.name === 'REWARDS') {
// // iconName = focused ? 'ios-gift' : 'ios-gift';
// return <Image source={require('../assets/icon/icon-rewards.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// } else if (route.name === 'ORDER') {
// // iconName = focused ? 'md-cart' : 'md-cart';
// return <Image source={require('../assets/icon/icon-order.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// } else if (route.name === 'OUTLETS') {
// // iconName = focused ? 'ios-cafe' : 'ios-cafe';
// return <Image source={require('../assets/icon/icon-outlets.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// } else if (route.name === 'ACCOUNT') {
// // iconName = focused ? 'account' : 'account';
// return <Image source={require('../assets/icon/icon-account.png')} style={{ height: 50, width: 50 }} tintColor={focused ? '#CFB368' : 'gray'} />
// }
// // You can return any component that you like here!
// return <Ionicons name={iconName} size={size} color={color} />;
// },
// })}
// tabBarOptions={{ activeTintColor: '#CFB368', inactiveTintColor: 'gray', showLabel: false }}
>
<Tab.Screen name="HOME" component={Home} />
......@@ -237,6 +238,9 @@ class Auth extends React.Component {
textAlign: 'center'
}, title: 'PROFILE'
}} />
<Stack.Screen name="UpdateVersion" component={UpdateVersion}
options={{ headerShown: false }}
/>
<Stack.Screen name="Change Profil" component={ChangeProfile} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
......@@ -282,11 +286,14 @@ class Auth extends React.Component {
textAlign: 'center'
}, title: 'EMAIL CONFIRMATION'
}} />
<Stack.Screen name="Login" component={Login} options={{headerShown:false}} />
<Stack.Screen name="Login" component={Login} options={{ headerShown: false }} />
<Stack.Screen name="LoginWelcome" component={WelcomeLog} options={{
headerShown: false,
}} />
<Stack.Screen name="Home" component={Home} options={{ headerShown: false }} />
<Stack.Screen name="UpdateVersion" component={UpdateVersion}
options={{ headerShown: false }}
/>
</>
) : (
<>
......@@ -388,19 +395,19 @@ class Auth extends React.Component {
title: 'TRANSFER BALANCE'
}} />
<Stack.Screen name="Register" component={Register} />
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
fontSize: 20,
color: 'white',
textAlign: 'center'
}, title: 'EMAIL CONFIRMATION'
}} />
<Stack.Screen name="Email Confirmation" component={EmailConfirmation} options={{
headerStyle: { backgroundColor: '#CFB368' },
headerTitleContainerStyle: { alignContent: 'center' },
headerTitleAlign: 'center',
headerTintColor: '#fff',
headerTitleStyle: {
alignSelf: 'center',
fontFamily: 'Gotham-Black',
fontSize: 20,
color: 'white',
textAlign: 'center'
}, title: 'EMAIL CONFIRMATION'
}} />
<Stack.Screen name="Upgrade Premium" component={UpgradePremium}
options={{
headerStyle: { backgroundColor: '#CFB368' },
......@@ -536,6 +543,10 @@ class Auth extends React.Component {
}, title: 'RATING ORDER'
}}
/>
<Stack.Screen name="UpdateVersion" component={UpdateVersion}
options={{ headerShown: false }}
/>
<Stack.Screen name="UseBalance" component={UseBalance}
options={{
headerStyle: { backgroundColor: '#CFB368' },
......@@ -624,7 +635,7 @@ class Auth extends React.Component {
<Stack.Screen name="Confirm Mobile" component={ConfirmMobile} />
<Stack.Screen name="Balance" component={Balance} />
<Stack.Screen name="Redeem Code" component={RedeemCode}
options={({ navigation }) => ({
options={({ navigation }) => ({
headerStyle: { backgroundColor: "#CFB368" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
......@@ -667,17 +678,17 @@ class Auth extends React.Component {
{/* <Stack.Screen name="Email Confirmation" component={EmailConfirmation} /> */}
<Stack.Screen name="News Detail" component={NewsDetail} options={{
headerStyle: { backgroundColor: "#CFB368" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 20,
},
title: 'NEWS DETAIL'
}} />
headerStyle: { backgroundColor: "#CFB368" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 20,
},
title: 'NEWS DETAIL'
}} />
<Stack.Screen name="CONFIRM YOUR ORDER" component={MenuConfirmation}
options={{
headerStyle: { backgroundColor: "#CFB368" },
......@@ -706,17 +717,17 @@ class Auth extends React.Component {
title: 'REGISTER'
}} />
<Stack.Screen name="TopUpInfo" component={TopUpInfo} options={{
headerStyle: { backgroundColor: "#CFB368" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 20,
},
title: 'TOPUP INFO '
}} />
headerStyle: { backgroundColor: "#CFB368" },
headerBackTitleStyle: { color: 'white' },
headerTintColor: '#fff',
headerTitleAlign: 'center',
headerTitleStyle: {
fontFamily: 'Gotham-Black',
color: 'white',
fontSize: 20,
},
title: 'TOPUP INFO '
}} />
<Stack.Screen name="Reward Detail" component={RewardDetail}
options={{
headerStyle: { backgroundColor: "#CFB368" },
......
......@@ -19,7 +19,7 @@ class EmailConfirmation extends React.Component {
}
componentDidMount() {
// console.log("SESSION " + this.props.session_id)
console.log("SESSION " + this.props.pageEmailConfirmation)
}
handleSubmit() {
......@@ -115,11 +115,20 @@ class EmailConfirmation extends React.Component {
}
handleCancel() {
let pageProps = {
pageEmailConfirmation: false
if (this.props.proses !== 'Register') {
let pageProps = {
isEmailverif: false
}
this.props.setPage(pageProps)
this.props.navigation.navigate('Login');
} else {
let pageProps = {
isEmailverif: false
}
this.props.setPage(pageProps)
this.props.navigation.navigate('New Register');
}
this.props.setPage(pageProps)
this.props.navigation.navigate('New Register');
}
handleResend() {
......@@ -147,7 +156,7 @@ class EmailConfirmation extends React.Component {
}).catch(error => {
let response = error.response.data;
Alert.alert('','Silahkan Cek Email Kembali');
Alert.alert('', 'Silahkan Cek Email Kembali');
this.setState({
spinner: false,
})
......@@ -186,6 +195,7 @@ class EmailConfirmation extends React.Component {
}
render() {
console.log(this.props.proses)
return (
<View style={styles.container}>
<MyStatusBar />
......@@ -216,9 +226,11 @@ class EmailConfirmation extends React.Component {
<TouchableOpacity style={{ height: 60 }} onPress={() => this.handleResend()}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20, top: 10 }}>RESEND EMAIL TOKEN</Text>
</TouchableOpacity>
<TouchableOpacity style={{ height: 60 }} onPress={() => this.props.navigation.navigate('Change Email')}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20, }}>CHANGE EMAIL</Text>
</TouchableOpacity>
{this.props.proses == 'Register' ? (
<TouchableOpacity style={{ height: 60 }} onPress={() => this.props.navigation.navigate('Change Email')}>
<Text style={{ alignSelf: 'center', color: '#CFB368', fontFamily: 'Gotham-Black', fontSize: 20, }}>CHANGE EMAIL</Text>
</TouchableOpacity>
) : (null)}
</View>
</View>
<View style={{ flex: 1, flexDirection: 'row' }}>
......
......@@ -10,6 +10,7 @@ import { Card } from 'react-native-shadow-cards';
import { connect } from 'react-redux';
import info from '../app.json';
import session from '../function/session';
import CheckVersion from '../function/CheckVersion';
import ActionType from '../redux/globalActionType';
import Toast from 'react-native-tiny-toast';
......@@ -29,6 +30,7 @@ class Home extends React.Component {
my_lat: 0,
my_long: 0,
indicator: true,
indicatorProfileCard: true,
slider_height: 350,
slugs: [],
placeholder: true
......@@ -36,10 +38,9 @@ class Home extends React.Component {
}
componentDidMount() {
console.log('ini outlet id' + this.props.outlet_id)
console.log('ini nama outlet ' + this.props.name_outlet)
console.log('ini alamat outlet ' + this.props.outlet_detailadress)
// const { navigation } = this.props
// CheckVersion(navigation)
const screenWidth = Math.round(Dimensions.get('window').width);
this.setState({
slider_height: screenWidth
......@@ -59,17 +60,19 @@ class Home extends React.Component {
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true,
indicatorProfileCard: true
})
this._account();
if (this.props.outlet_id == '' && this.props.name_outlet == '' && this.props.outlet_detailadress == '') {
this._getPermissions()
} else {
this.setState({
indicator: false
indicator: false,
})
}
this._renderCarousell()
// CheckVersion(navigation)
});
}
......@@ -155,7 +158,7 @@ class Home extends React.Component {
balance: balance,
account_number: account_number,
expire_date: expire,
indicator: false
indicatorProfileCard: false
})
}).catch(error => {
let response = error.response.data
......@@ -372,7 +375,13 @@ class Home extends React.Component {
{
this.state.indicator == true ? (<ActivityIndicator style={{ top: 20, justifyContent: "center" }} size="large" color="#c9af6d" />) :
this.state.indicatorProfileCard == true ? (
<View style={styles.card}>
<Card style={{ padding: 50, margin: 10, alignContent: 'center' }}>
<ActivityIndicator style={{ justifyContent: "center" }} size="large" color="#c9af6d" />
</Card>
</View>
) :
this.state.account_number === "" ? (
<View style={styles.card}>
<Card style={{ padding: 10, margin: 10, alignContent: 'center' }}>
......@@ -453,9 +462,9 @@ class Home extends React.Component {
<View style={{ flexDirection: 'row', flex: 1 }}>
<TouchableOpacity
// style={styles.submitUpgradePemium}
activeOpacity={.5}
activeOpacity={.5}
onPress={() => this.props.navigation.navigate('TopUpInfo')}
>
>
<View style={{
flex: 0.5,
height: 40,
......@@ -662,6 +671,7 @@ const mapStateToProps = (state) => {
// login
in_payment: state.in_payment,
BASE_URL : state.BASE_URL,
email: state.email,
outlet_id: state.outlet_id,
name_outlet: state.name_outlet,
......
......@@ -43,8 +43,8 @@ class Item extends React.Component {
handleEdit = (item) => {
let note = ''
if (this.state.notes === '') {
note = item.note;
if (this.state.notes == '') {
note = '';
} else {
note = this.state.notes;
}
......
......@@ -45,7 +45,7 @@ class ItemShoping extends React.Component {
handleEdit = (item) =>{
let note = ''
if (this.state.note === '') {
note = item.note;
note = '';
} else {
note = this.state.note;
}
......
......@@ -11,6 +11,7 @@ import { BASE_URL_LOGIN } from '../model/Base_Model';
import { Notifications } from 'expo';
import Spinner from 'react-native-loading-spinner-overlay';
import Toast from 'react-native-tiny-toast';
import CheckVersion from '../function/CheckVersion';
class Login extends React.Component {
constructor(props) {
......@@ -31,11 +32,10 @@ class Login extends React.Component {
}
componentDidMount() {
// console.log(this.props.language)
const { navigation } = this.props
console.log(this.props.navigation)
CheckVersion(navigation)
this._getDeviceInfo()
}
_getDeviceInfo = async () => {
......@@ -166,7 +166,7 @@ class Login extends React.Component {
}
let prosesProps = {
proses: 'Register'
proses: ''
}
this.props.setProses(prosesProps);
......@@ -185,8 +185,6 @@ class Login extends React.Component {
],
})
}).catch(error => {
let response = error.response.data;
......@@ -228,11 +226,12 @@ class Login extends React.Component {
}
render() {
console.log(this.props.device_id)
console.log(this.props.os_name)
console.log(this.props.fb_token)
console.log(this.props.os_version)
console.log(this.props.app_version)
// console.log(this.props.device_id)
// console.log(this.props.os_name)
// console.log(this.props.fb_token)
// console.log(this.props.os_version)
// console.log(this.props.app_version)
return (
<View style={styles.container}>
<Spinner
......
import React from 'react';
import { View, Text, TextInput, StyleSheet, Button, Alert, TouchableOpacity, Image } from 'react-native';
import { View, Text, TextInput, StyleSheet, Button, Alert, TouchableOpacity, Image, ImageBackground, ScrollView } from 'react-native';
import { connect } from 'react-redux';
import Axios from 'axios';
import ActionType from '../redux/globalActionType';
......@@ -82,7 +82,7 @@ class NewPassword extends React.Component {
textStyle={styles.spinnerTextStyle}
/>
<View style={{ flex: 3 }}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 50 }}>
<View style={{ flex: 1, marginRight: 30, marginLeft: 30, top: 20 }}>
<Text style={{ fontFamily: 'Gotham-Black', color: '#CFB368', fontSize: 20, textAlign: 'center', margin: 3 }}>Email</Text>
<Text style={{ fontFamily: 'Gotham-Black', color: '#838383', fontSize: 18, textAlign: 'center', margin: 3, marginBottom: 15 }}>{this.props.email}</Text>
......@@ -112,7 +112,7 @@ class NewPassword extends React.Component {
<View style={{ flex: 1, flexDirection: 'row' }}>
<View style={styles.v_logo}>
<View style={{ flex: 1, alignSelf: 'flex-start' }}>
<Image resizeMode="contain" source={require('../assets/images/daun.png')} style={styles.logo}></Image>
<Image resizeMode="contain" source={require('../assets/images/daun.png')} style={styles.logo} />
</View>
<View style={{ flex: 1 }}>
</View>
......
......@@ -37,18 +37,26 @@ class Outlets extends React.Component {
}
componentDidMount() {
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true,
})
// this._getOutletClosest()
this.OrderedList()
this._getPermissions()
});
// this._getOutletClosest()
this.OrderedList()
this._getPermissions()
// this._unsubscribe = this.props.navigation.addListener('focus', () => {
// this.setState({
// indicator: true,
// })
// // this._getOutletClosest()
// this.OrderedList()
// this._getPermissions()
// });
}
// componentWillUnmount() {
// this._unsubscribe()
// }
_getPermissions = async () => {
let { status } = await Permissions.askAsync(Permissions.LOCATION);
if (status !== 'granted') {
......@@ -176,7 +184,7 @@ class Outlets extends React.Component {
// let outletName = res.data.data.outlet_name
// this.setState({
// indicator: false,
// // indicator: false,
// data_name: outletName
// })
......@@ -315,24 +323,25 @@ class Outlets extends React.Component {
placeholder={{ label: 'All City' }}
onValueChange={(label) => this.filterData(label)}
items={this.state.data_outlet}
style={{inputIOSContainer: {paddingVertical: 10, alignItems: 'center'}}}
style={{ inputIOSContainer: { paddingVertical: 10, alignItems: 'center' } }}
/>
</View>
</View>
<View style={styles.body}>
{this.state.dataOutlets.length > 0 ? (
<FlatList
data={_.orderBy(this.state.dataOutlets, ['distance'], ['asc'])}
renderItem={this.RenderItem}
keyExtractor={item => item.id}
windowSize={5}
initialNumToRender={18}
maxToRenderPerBatch={2}
onEndReachedThreshold={0.5}
/>
) : (
<Text style={{ flexWrap: 'wrap', fontFamily: 'Gotham-Light', color: '#b1b1b2', textAlign:'center' }}> Tidak Ada Outlets di area anda !</Text>
)}
{this.state.indicator ? (<ActivityIndicator style={{ top: 20, justifyContent: "center" }} size="large" color="#c9af6d" />) : (
this.state.dataOutlets.length > 0 ? (
<FlatList
data={_.orderBy(this.state.dataOutlets, ['distance'], ['asc'])}
renderItem={this.RenderItem}
keyExtractor={item => item.id}
windowSize={5}
initialNumToRender={18}
maxToRenderPerBatch={2}
onEndReachedThreshold={0.5}
/>
) : (
<Text style={{ flexWrap: 'wrap', fontFamily: 'Gotham-Light', color: '#b1b1b2', textAlign: 'center' }}> Tidak Ada Outlets di area anda !</Text>
))}
</View>
</View>
......
import React from 'react';
import { View, Text, Image, StyleSheet, ScrollView, Alert, TouchableOpacity } from 'react-native';
import { View, Text, Image, StyleSheet, ScrollView, Alert, TouchableOpacity, ActivityIndicator } from 'react-native';
import { Card } from 'react-native-shadow-cards'
import { connect } from 'react-redux';
import Axios from 'axios';
......@@ -9,13 +9,17 @@ class RewardsList extends React.Component {
constructor(props) {
super(props)
this.state = {
rewardsList: []
rewardsList: [],
indicator: true
}
}
componentDidMount() {
this.getRewardsList()
this._unsubscribe = this.props.navigation.addListener('focus', () => {
this.setState({
indicator: true
})
this.getRewardsList()
});
......@@ -38,7 +42,8 @@ class RewardsList extends React.Component {
})
// console.log(data)
this.setState({
rewardsList: data
rewardsList: data,
indicator: false
})
}).catch(error => {
......@@ -55,36 +60,37 @@ class RewardsList extends React.Component {
</View>
<ScrollView style={styles.body}>
{
this.state.rewardsList.length ? (
this.state.rewardsList.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: item.id })}>
<View style={{ alignItems: 'center' }}>
<Card style={{ padding: 5, margin: 5 }}>
<View>
<Image source={{ uri: item.reward.title_image }}
resizeMethod="resize"
resizeMode='cover'
style={{ height: 100, width: '100%' }} />
</View>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View style={{ flex: 0.6}}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Black', color: '#838383' }}>{item.reward.title}</Text>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{item.reward.subtitle}</Text>
this.state.indicator ? (<ActivityIndicator style={{ top: 20, justifyContent: "center" }} size="large" color="#c9af6d" />) : (
this.state.rewardsList.length ? (
this.state.rewardsList.map((item, key) => (
<TouchableOpacity key={key} onPress={() => this.props.navigation.navigate('Reward Detail', { rewardId: item.id })}>
<View style={{ alignItems: 'center' }}>
<Card style={{ padding: 5, margin: 5 }}>
<View>
<Image source={{ uri: item.reward.title_image }}
resizeMethod="resize"
resizeMode='cover'
style={{ height: 100, width: '100%' }} />
</View>
<View style={{ flex: 0.4}}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>Expired On</Text>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{item.expire_time}</Text>
<View style={{ flex: 1, flexDirection: 'row', justifyContent: 'space-between', padding: 10 }}>
<View style={{ flex: 0.6 }}>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Black', color: '#838383' }}>{item.reward.title}</Text>
<Text style={{ textAlign: 'left', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{item.reward.subtitle}</Text>
</View>
<View style={{ flex: 0.4 }}>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>Expired On</Text>
<Text style={{ textAlign: 'right', fontSize: 12, fontFamily: 'Gotham-Light', color: '#838383' }}>{item.expire_time}</Text>
</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>
</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>
)
))
}
<TouchableOpacity style={{ marginVertical: 20 }} onPress={() => this.props.navigation.navigate('Reward History')}>
<Text style={{ textAlign: 'center', color: '#CFB368', fontSize: 12, fontFamily: 'Gotham-Black' }}>REDEEM E-VOUCHER HISTORY</Text>
......@@ -103,7 +109,7 @@ const styles = StyleSheet.create({
},
header: {
flex: 0.1,
marginBottom:5,
marginBottom: 5,
backgroundColor: '#CFB368',
justifyContent: 'center'
},
......
import Axios from 'axios';
import React from 'react';
import { ScrollView, StyleSheet, Text, View, Image, StatusBar } from 'react-native';
import { TouchableOpacity } from 'react-native-gesture-handler';
import HTML from 'react-native-render-html';
import { Collapse, CollapseHeader, CollapseBody, AccordionList } from 'accordion-collapse-react-native'
import { getStatusBarHeight } from 'react-native-status-bar-height';
import MyStatusBar from './MyStatusBar';
export default class UpdateVersion extends React.Component {
constructor(props) {
super(props);
this.state = {
}
}
componentDidMount() {
}
render() {
return (
<View style={{ justifyContent: 'center', alignItems: 'center', flex: 1, backgroundColor:'white' }}>
<Text>Mohon update aplikasi terlebih dahulu</Text>
</View>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: 'white'
},
headerTitle: {
flex: 1,
textAlign: 'center',
margin: 20,
fontSize: 23,
alignSelf: 'center',
color: 'white',
fontFamily: 'Gotham-Black'
},
image_container: (height) => ({
height: height,
backgroundColor: 'gray'
}),
image: (height) => ({
width: '100%',
height: height
}),
title: {
textAlign: 'center',
fontFamily: 'Gotham-Black',
fontSize: 22,
marginBottom: 10,
color: '#CFB368'
},
content: {
paddingHorizontal: 20,
paddingVertical: 25
},
item_container: {
borderColor: 'gray',
borderWidth: 1,
borderRadius: 10,
marginBottom: 20,
color: '#adadad'
},
item_title: {
fontSize: 18,
color: '#adadad',
fontFamily: 'Gotham-Black',
flex: 1,
alignSelf: 'center',
},
item_image: {
width: 96,
height: 28,
alignItems: 'flex-end'
}
})
\ No newline at end of file
import * as React from 'react';
import { Button, View, Text, TextInput, StyleSheet, Alert, Platform, Image, TouchableOpacity, StatusBar, ImageBackground, ScrollView } from 'react-native';
import Spinner from 'react-native-loading-spinner-overlay';
import CheckVersion from '../function/CheckVersion';
export default class WelcomeLog extends React.Component {
constructor(props) {
......@@ -11,7 +12,8 @@ export default class WelcomeLog extends React.Component {
}
componentDidMount() {
// console.log(this.props.language)
const { navigation } = this.props
CheckVersion(navigation)
}
......
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