2019-03-12 16:23:06 +00:00
|
|
|
import React from 'react';
|
2021-10-01 18:12:19 +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-30 22:01:25 +00:00
|
|
|
import { useTheme } from '../theme';
|
2020-02-28 20:11:08 +00:00
|
|
|
import sharedStyles from './Styles';
|
2022-05-30 22:01:25 +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-30 22:01:25 +00:00
|
|
|
const AuthLoadingView = React.memo((): React.ReactElement => {
|
|
|
|
const text = useAppSelector(state => state.app.text);
|
|
|
|
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-30 22:01:25 +00:00
|
|
|
export default AuthLoadingView;
|