diff --git a/components/ui/Loader.tsx b/components/ui/Loader.tsx index 2543ff1cae..e7f3d10550 100644 --- a/components/ui/Loader.tsx +++ b/components/ui/Loader.tsx @@ -1,14 +1,22 @@ -import React, {Fragment} from 'react'; +import React, {Fragment, useEffect} from 'react'; import {useTranslation} from 'react-i18next'; -import {Image, SafeAreaView, View} from 'react-native'; +import {BackHandler, Image, SafeAreaView, View} from 'react-native'; import Spinner from 'react-native-spinkit'; import {Button, Centered, Column, Row, Text} from '../../components/ui'; -import {Theme} from '../../components/ui/styleUtils'; +import {Theme} from './styleUtils'; import testIDProps from '../../shared/commonUtil'; export const Loader: React.FC = props => { const {t} = useTranslation('ScanScreen'); + useEffect(() => { + const backHandler = BackHandler.addEventListener( + 'hardwareBackPress', + () => true, + ); + return () => backHandler.remove(); + }, []); + return (