Commit 522814a7 authored by Trisno's avatar Trisno

ganti toast support android dan ios

parent 6fb1cd27
......@@ -6896,6 +6896,11 @@
"resolved": "https://registry.npmjs.org/react-native-shadow-cards/-/react-native-shadow-cards-1.0.2.tgz",
"integrity": "sha512-cUk9+4T8XTwWPKJzLxmnFia9i0m5PWdLPrtGiShVH5vVH48TZ/8JLBzsUe50tfzTxvMWPvQM1vZE8Sytfj1mjw=="
},
"react-native-simple-toast": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/react-native-simple-toast/-/react-native-simple-toast-1.1.2.tgz",
"integrity": "sha512-p13p6Db9viLBxbAlicVLD6CcrbkmqQoEjP20vY+SxbO3y5cdmY0AOn/FiMC+iuC4eQxk0SFeJm4PFRWby/ntyg=="
},
"react-native-snap-carousel": {
"version": "3.8.4",
"resolved": "https://registry.npmjs.org/react-native-snap-carousel/-/react-native-snap-carousel-3.8.4.tgz",
......
......@@ -19,6 +19,7 @@
"accordion-collapse-react-native": "^0.2.8",
"axios": "^0.19.2",
"expo": "~36.0.0",
"expo-application": "~2.0.0",
"expo-camera": "~8.0.0",
"expo-constants": "^8.0.0",
"expo-device": "^2.0.0",
......@@ -61,6 +62,7 @@
"react-native-scroll-into-view": "^1.0.3",
"react-native-scrollable-tab-view": "^1.0.0",
"react-native-shadow-cards": "^1.0.2",
"react-native-simple-toast": "^1.1.2",
"react-native-status-bar-height": "^2.5.0",
"react-native-swiper": "^1.5.14",
"react-native-view-pager": "^0.2.3",
......@@ -74,8 +76,7 @@
"redux": "^4.0.5",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.3.0",
"sentry-expo": "^2.0.4",
"expo-application": "~2.0.0"
"sentry-expo": "^2.0.4"
},
"devDependencies": {
"babel-preset-expo": "~8.0.0",
......
......@@ -26,6 +26,7 @@ import * as Permissions from 'expo-permissions';
import * as Device from 'expo-device';
import session from '../function/session';
import Constants from 'expo-constants';
import Toast from 'react-native-simple-toast'
class Account extends React.Component {
constructor(props) {
......@@ -153,7 +154,7 @@ class Account extends React.Component {
// session(response, navigation)
let response = error.response.data
// Alert.alert('',response.msg);
ToastAndroid.show(response.msg, ToastAndroid.SHORT)
Toast.show(response.msg)
})
}
......
......@@ -11,6 +11,7 @@ import { connect } from 'react-redux';
import info from '../app.json';
import session from '../function/session';
import ActionType from '../redux/globalActionType';
import Toast from 'react-native-simple-toast'
let version = info.expo.version
let buildNumber = info.expo.android.versionCode
......@@ -81,11 +82,11 @@ class Home extends React.Component {
let { status } = await Permissions.askAsync(Permissions.LOCATION);
if (status !== 'granted') {
// Alert.alert('Akses tidak dizinkan!')
ToastAndroid.show("Akses tidak dizinkan!", ToastAndroid.SHORT)
Toast.show("Akses tidak dizinkan!")
} else if (Platform.OS === 'android' && !Device.isDevice) {
// Alert.alert('Silahkan anda coba di real Device')
ToastAndroid.show("Silahkan anda coba di real Device", ToastAndroid.SHORT)
Toast.show("Silahkan anda coba di real Device")
} else {
this._getCurrentPosisition()
}
......@@ -160,7 +161,7 @@ class Home extends React.Component {
}).catch(error => {
let response = error.response.data
// Alert.alert('',response.msg);
ToastAndroid.show(response.msg, ToastAndroid.SHORT)
Toast.show(response.msg)
})
}
......@@ -190,7 +191,7 @@ class Home extends React.Component {
}).catch(error => {
let response = error.response.data
// Alert.alert('',response.msg);
ToastAndroid.show(response.msg, ToastAndroid.SHORT)
Toast.show(response.msg)
})
}
......@@ -221,7 +222,7 @@ class Home extends React.Component {
} else {
// Alert.alert('Belum dapat outlet terdekat')
ToastAndroid.show('Belum dapat outlet terdekat', ToastAndroid.SHORT)
Toast.show('Belum dapat outlet terdekat')
}
}
......@@ -453,7 +454,9 @@ class Home extends React.Component {
<View style={{ flexDirection: 'row', flex: 1 }}>
<TouchableOpacity
// style={styles.submitUpgradePemium}
activeOpacity={.5} onPress={() => this.props.navigation.navigate('TopUpInfo')}>
activeOpacity={.5}
onPress={() => this.props.navigation.navigate('TopUpInfo')}
>
<View style={{
flex: 0.5,
height: 40,
......@@ -462,11 +465,11 @@ class Home extends React.Component {
marginLeft: -10,
paddingVertical: 12,
paddingRight: 10,
paddingLeft: 14,
paddingLeft: 10,
borderRadius: 10,
backgroundColor: '#CFB368',
}}>
<Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 14 }}>TOP UP BALANCE </Text>
<Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 14 }}>TOP UP BALANCE</Text>
</View>
</TouchableOpacity>
<TouchableOpacity
......@@ -483,7 +486,7 @@ class Home extends React.Component {
borderRadius: 10,
backgroundColor: '#CFB368',
}}>
<Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 14 }}>USE BALANCE </Text>
<Text style={{ textAlign: 'center', color: 'white', fontFamily: 'Gotham-Black', fontSize: 14 }}>USE BALANCE</Text>
</View>
</TouchableOpacity>
</View>
......
......@@ -4,6 +4,7 @@ import { connect } from 'react-redux';
import Axios from 'axios';
import ActionType from '../redux/globalActionType';
import NumberFormat from 'react-number-format';
import Toast from 'react-native-simple-toast'
class RedeemCode extends React.Component {
......@@ -48,7 +49,7 @@ class RedeemCode extends React.Component {
this.props.setRedeem(redeemProps)
// Alert.alert('', 'Berhasil dibatalkan')
ToastAndroid.show("berhasil dibatalkan", ToastAndroid.SHORT)
Toast.show("berhasil dibatalkan")
this.props.navigation.navigate('Home', { screen: 'HOME' });
}).catch(error => {
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