2019-03-12 16:23:06 +00:00
|
|
|
import React from 'react';
|
2021-09-13 20:41:05 +00:00
|
|
|
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native';
|
2019-03-12 16:23:06 +00:00
|
|
|
|
2020-02-28 20:11:08 +00:00
|
|
|
import I18n from '../i18n';
|
2019-03-12 16:23:06 +00:00
|
|
|
import StatusBar from '../containers/StatusBar';
|
2022-05-03 16:25:18 +00:00
|
|
|
import { useTheme } from '../theme';
|
2020-02-28 20:11:08 +00:00
|
|
|
import sharedStyles from './Styles';
|
2022-05-13 15:01:34 +00:00
|
|
|
import { useAppSelector } from '../lib/hooks';
|
2020-02-28 20:11:08 +00:00
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
flex: 1,
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center'
|
|
|
|
},
|
|
|
|
text: {
|
|
|
|
fontSize: 16,
|
|
|
|
paddingTop: 10,
|
|
|
|
...sharedStyles.textRegular,
|
|
|
|
...sharedStyles.textAlignCenter
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-05-03 16:25:18 +00:00
|
|
|
const AuthLoadingView = React.memo((): React.ReactElement => {
|
2022-05-13 15:01:34 +00:00
|
|
|
const text = useAppSelector(state => state.app.text);
|
2022-05-03 16:25:18 +00:00
|
|
|
const { colors } = useTheme();
|
|
|
|
return (
|
|
|
|
<View style={[styles.container, { backgroundColor: colors.backgroundColor }]}>
|
|
|
|
<StatusBar />
|
|
|
|
{text ? (
|
|
|
|
<>
|
|
|
|
<ActivityIndicator color={colors.auxiliaryText} size='large' />
|
|
|
|
<Text style={[styles.text, { color: colors.bodyText }]}>{`${text}\n${I18n.t('Please_wait')}`}</Text>
|
|
|
|
</>
|
|
|
|
) : null}
|
|
|
|
</View>
|
|
|
|
);
|
2020-06-15 14:00:46 +00:00
|
|
|
});
|
|
|
|
|
2022-05-03 16:25:18 +00:00
|
|
|
export default AuthLoadingView;
|