Rocket.Chat.ReactNative/app/views/AuthLoadingView.js

41 lines
1018 B
JavaScript
Raw Normal View History

2019-03-12 16:23:06 +00:00
import React from 'react';
import {
View, Text, StyleSheet, ActivityIndicator
} from 'react-native';
2019-03-12 16:23:06 +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';
import { themes } from '../constants/colors';
2019-03-12 16:23:06 +00:00
import sharedStyles from './Styles';
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center'
},
text: {
fontSize: 16,
paddingTop: 10,
...sharedStyles.textRegular,
...sharedStyles.textAlignCenter
}
});
export default React.memo(withTheme(({ theme, navigation }) => {
const text = navigation.getParam('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>
);
}));