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';
|
2020-06-15 14:00:46 +00:00
|
|
|
import { connect } from 'react-redux';
|
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';
|
2019-12-04 16:39:53 +00:00
|
|
|
import { withTheme } from '../theme';
|
2020-02-28 20:11:08 +00:00
|
|
|
import { themes } from '../constants/colors';
|
|
|
|
import sharedStyles from './Styles';
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
flex: 1,
|
|
|
|
justifyContent: 'center',
|
|
|
|
alignItems: 'center'
|
|
|
|
},
|
|
|
|
text: {
|
|
|
|
fontSize: 16,
|
|
|
|
paddingTop: 10,
|
|
|
|
...sharedStyles.textRegular,
|
|
|
|
...sharedStyles.textAlignCenter
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2021-10-28 17:49:08 +00:00
|
|
|
interface IAuthLoadingView {
|
|
|
|
theme: string;
|
|
|
|
text: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const AuthLoadingView = React.memo(({ theme, text }: IAuthLoadingView) => (
|
2020-06-15 14:00:46 +00:00
|
|
|
<View style={[styles.container, { backgroundColor: themes[theme].backgroundColor }]}>
|
2020-10-30 13:59:44 +00:00
|
|
|
<StatusBar />
|
2021-10-28 17:49:08 +00:00
|
|
|
{text ? (
|
2020-06-15 14:00:46 +00:00
|
|
|
<>
|
|
|
|
<ActivityIndicator color={themes[theme].auxiliaryText} size='large' />
|
2021-10-01 18:12:19 +00:00
|
|
|
<Text style={[styles.text, { color: themes[theme].bodyText }]}>{`${text}\n${I18n.t('Please_wait')}`}</Text>
|
2020-06-15 14:00:46 +00:00
|
|
|
</>
|
2021-10-28 17:49:08 +00:00
|
|
|
) : null}
|
2020-06-15 14:00:46 +00:00
|
|
|
</View>
|
|
|
|
));
|
|
|
|
|
2021-10-28 17:49:08 +00:00
|
|
|
const mapStateToProps = (state: any) => ({
|
2020-06-15 14:00:46 +00:00
|
|
|
text: state.app.text
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(withTheme(AuthLoadingView));
|