Commit 28a9d4c6 authored by Wahyu Adjie Prasetyo's avatar Wahyu Adjie Prasetyo

update version

parent 2abb5789
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
...@@ -10,6 +10,7 @@ import { Card } from 'react-native-shadow-cards'; ...@@ -10,6 +10,7 @@ import { Card } from 'react-native-shadow-cards';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import info from '../app.json'; import info from '../app.json';
import session from '../function/session'; import session from '../function/session';
import CheckVersion from '../function/CheckVersion';
import ActionType from '../redux/globalActionType'; import ActionType from '../redux/globalActionType';
import Toast from 'react-native-tiny-toast'; import Toast from 'react-native-tiny-toast';
...@@ -37,10 +38,9 @@ class Home extends React.Component { ...@@ -37,10 +38,9 @@ class Home extends React.Component {
} }
componentDidMount() { componentDidMount() {
console.log('ini outlet id' + this.props.outlet_id) const { navigation } = this.props
console.log('ini nama outlet ' + this.props.name_outlet) CheckVersion(navigation)
console.log('ini alamat outlet ' + this.props.outlet_detailadress)
const screenWidth = Math.round(Dimensions.get('window').width); const screenWidth = Math.round(Dimensions.get('window').width);
this.setState({ this.setState({
slider_height: screenWidth slider_height: screenWidth
...@@ -671,6 +671,7 @@ const mapStateToProps = (state) => { ...@@ -671,6 +671,7 @@ const mapStateToProps = (state) => {
// login // login
in_payment: state.in_payment, in_payment: state.in_payment,
BASE_URL : state.BASE_URL,
email: state.email, email: state.email,
outlet_id: state.outlet_id, outlet_id: state.outlet_id,
name_outlet: state.name_outlet, name_outlet: state.name_outlet,
......
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 TopUpInfo extends React.Component {
constructor(props) {
super(props);
this.state = {
}
}
componentDidMount() {
}
render() {
return (
<View style={styles.container}>
<ScrollView>
<View style={styles.content}>
<View>
</View>
</View>
</ScrollView>
</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
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