AuthLoadingView

This commit is contained in:
Diego Mello 2020-05-26 17:11:21 -03:00
parent 99e4dfcce0
commit c60bdfb208
1 changed files with 24 additions and 14 deletions

View File

@ -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,9 +26,7 @@ const styles = StyleSheet.create({
}
});
export default React.memo(withTheme(({ theme, route }) => {
const text = route.params?.text;
return (
const AuthLoadingView = React.memo(({ theme, text }) => (
<View style={[styles.container, { backgroundColor: themes[theme].backgroundColor }]}>
<StatusBar theme={theme} />
{text && (
@ -36,5 +36,15 @@ export default React.memo(withTheme(({ theme, route }) => {
</>
)}
</View>
);
}));
));
const mapStateToProps = state => ({
text: state.app.text
});
AuthLoadingView.propTypes = {
theme: PropTypes.string,
text: PropTypes.string
};
export default connect(mapStateToProps)(withTheme(AuthLoadingView));