import React from 'react' import { useLanguage } from 'ordering-components/native' import { Dimensions } from 'react-native' import RNRestart from 'react-native-restart' import { OText, OIcon, OButton } from '../shared' import { useTheme } from 'styled-components/native' import { NoNetworkParams } from '../../types' import { Container, ImageContainer } from './styles' export const NetworkError = (props: NoNetworkParams) => { const { image } = props const theme = useTheme() const [, t] = useLanguage() const urlimage = theme?.no_internet?.components?.image const noNetworkImage = image || theme.images.general.noNetwork const deviceWidth = Dimensions.get('screen').width return ( {t('MOBILE_NO_INTERNET', 'No internet connection')} {t('NETWORK_OFFLINE_MESSAGE', 'Your connection appears to be off-line. Try to refresh the page')} RNRestart.Restart()} /> ) }