import * as React from 'react' import { WithTranslation } from 'react-i18next' import { StyleSheet, View } from 'react-native' import { SafeAreaView } from 'react-native-safe-area-context' import Button, { BtnTypes } from 'src/components/Button' import { withTranslation } from 'src/i18n' import colors from 'src/styles/colors' import { RESTART_APP_I18N_KEY, restartApp } from 'src/utils/AppRestart' const SHOW_RESTART_BUTTON_TIMEOUT = 10000 interface State { showRestartButton: boolean } type Props = {} & WithTranslation export class AppLoading extends React.Component { showRestartButtonTimer: number | null = null state = { showRestartButton: false, } componentDidMount() { this.showRestartButtonTimer = window.setTimeout( this.showRestartButton, SHOW_RESTART_BUTTON_TIMEOUT ) } componentWillUnmount() { if (this.showRestartButtonTimer) { clearTimeout(this.showRestartButtonTimer) } } showRestartButton = () => { this.setState({ showRestartButton: true }) } render() { const { t } = this.props return ( {this.state.showRestartButton && (