NoConnection.js 1.54 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
import React from 'react';
import {
  SafeAreaView,
  View,
  Text,
  Linking,
  StyleSheet,
  Dimensions,
  Image,
  Platform,
} from 'react-native';
//Screen
import {IMAGES} from '../../values/images';
//Values
import string from '../../values/string';
import Alert from 'react-native-awesome-alerts';
const windowWidth = Dimensions.get('window').width;
const windowHeight = Dimensions.get('window').height;
function NoConnection({isShow}) {
  const onOpenSetting = () => {
    Platform.OS === 'ios'
      ? Linking.openURL('App-Prefs:Wifi')
      : // Linking.openSettings('app-settings:');
        Linking.sendIntent('android.settings.SETTINGS');
  };

  return (
    <SafeAreaView style={styles.container}>
      <Alert
        show={isShow}
        showProgress={false}
        title={'Hệ thống'}
        message={'Vui lòng đổi wifi hoặc sử dụng 4G'}
        closeOnTouchOutside={false}
        closeOnHardwareBackPress={false}
        showConfirmButton={true}
        confirmText="Open setting"
        confirmButtonColor="#DD6B55"
        onConfirmPressed={onOpenSetting}
      />
    </SafeAreaView>
  );
}
const styles = StyleSheet.create({
  container: {},
  mainView: {
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: 'white',
  },
  textWrapper: {
    justifyContent: 'center',
    alignItems: 'center',
    flexDirection: 'row',
  },
  text: {
    textAlign: 'center',
    marginLeft: 50,
    marginRight: 50,
    color: 'black',
  },
  emptyView: {flex: 2, backgroundColor: 'white'},
});
export default NoConnection;