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

60 lines
1.5 KiB
JavaScript
Raw Normal View History

2019-07-18 17:44:02 +00:00
import React from 'react';
import {
StyleSheet, View, Text
} from 'react-native';
2019-12-04 16:39:53 +00:00
import PropTypes from 'prop-types';
2019-07-18 17:44:02 +00:00
import ShareExtension from 'rn-extensions-share';
import { CancelModalButton } from '../containers/HeaderButton';
2019-07-18 17:44:02 +00:00
import sharedStyles from './Styles';
import I18n from '../i18n';
2019-12-04 16:39:53 +00:00
import { themes } from '../constants/colors';
import { themedHeader } from '../utils/navigation';
import { withTheme } from '../theme';
2019-07-18 17:44:02 +00:00
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
2019-07-29 16:33:28 +00:00
alignItems: 'center',
padding: 15
2019-07-18 17:44:02 +00:00
},
title: {
fontSize: 18,
2019-12-04 16:39:53 +00:00
...sharedStyles.textBold
2019-07-18 17:44:02 +00:00
},
content: {
fontSize: 14,
...sharedStyles.textAlignCenter,
...sharedStyles.textRegular
}
});
2019-12-04 16:39:53 +00:00
class WithoutServerView extends React.Component {
static navigationOptions = ({ screenProps }) => ({
...themedHeader(screenProps.theme),
2019-07-18 17:44:02 +00:00
headerLeft: (
<CancelModalButton
2019-07-18 17:44:02 +00:00
onPress={ShareExtension.close}
testID='share-extension-close'
/>
)
})
2019-12-04 16:39:53 +00:00
static propTypes = {
theme: PropTypes.string
}
2019-07-18 17:44:02 +00:00
render() {
2019-12-04 16:39:53 +00:00
const { theme } = this.props;
2019-07-18 17:44:02 +00:00
return (
2019-12-04 16:39:53 +00:00
<View style={[styles.container, { backgroundColor: themes[theme].backgroundColor }]}>
<Text style={[styles.title, { color: themes[theme].titleText }]}>{I18n.t('Without_Servers')}</Text>
<Text style={[styles.content, { color: themes[theme].titleText }]}>{I18n.t('You_need_to_access_at_least_one_RocketChat_server_to_share_something')}</Text>
2019-07-18 17:44:02 +00:00
</View>
);
}
}
2019-12-04 16:39:53 +00:00
export default withTheme(WithoutServerView);