AuthLoadingView
This commit is contained in:
parent
99e4dfcce0
commit
c60bdfb208
|
@ -2,6 +2,8 @@ import React from 'react';
|
|||
import {
|
||||
View, Text, StyleSheet, ActivityIndicator
|
||||
} from 'react-native';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import I18n from '../i18n';
|
||||
import StatusBar from '../containers/StatusBar';
|
||||
|
@ -24,17 +26,25 @@ const styles = StyleSheet.create({
|
|||
}
|
||||
});
|
||||
|
||||
export default React.memo(withTheme(({ theme, route }) => {
|
||||
const text = route.params?.text;
|
||||
return (
|
||||
<View style={[styles.container, { backgroundColor: themes[theme].backgroundColor }]}>
|
||||
<StatusBar theme={theme} />
|
||||
{text && (
|
||||
<>
|
||||
<ActivityIndicator color={themes[theme].auxiliaryText} size='large' />
|
||||
<Text style={[styles.text, { color: themes[theme].bodyText }]}>{`${ text }\n${ I18n.t('Please_wait') }`}</Text>
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
}));
|
||||
const AuthLoadingView = React.memo(({ theme, text }) => (
|
||||
<View style={[styles.container, { backgroundColor: themes[theme].backgroundColor }]}>
|
||||
<StatusBar theme={theme} />
|
||||
{text && (
|
||||
<>
|
||||
<ActivityIndicator color={themes[theme].auxiliaryText} size='large' />
|
||||
<Text style={[styles.text, { color: themes[theme].bodyText }]}>{`${ text }\n${ I18n.t('Please_wait') }`}</Text>
|
||||
</>
|
||||
)}
|
||||
</View>
|
||||
));
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
text: state.app.text
|
||||
});
|
||||
|
||||
AuthLoadingView.propTypes = {
|
||||
theme: PropTypes.string,
|
||||
text: PropTypes.string
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps)(withTheme(AuthLoadingView));
|
||||
|
|
Loading…
Reference in New Issue