BlueWallet/App.js

86 lines
2 KiB
JavaScript
Raw Normal View History

2018-03-17 22:39:21 +02:00
import './shim.js';
import React from 'react';
import PropTypes from 'prop-types';
import { Text, ScrollView, StyleSheet } from 'react-native';
import { DrawerNavigator, SafeAreaView } from 'react-navigation';
import MainBottomTabs from './MainBottomTabs';
2018-03-24 21:24:20 +00:00
import Selftest from './screen/selftest';
2018-03-31 14:43:08 +01:00
import About from './screen/about';
2018-04-01 00:16:42 +01:00
import PlausibleDeniability from './screen/plausibledeniability';
2018-03-17 20:43:34 +02:00
2018-05-28 20:18:11 +01:00
/** @type {AppStorage} */
2018-03-17 22:39:21 +02:00
require('./BlueApp');
2018-03-17 20:43:34 +02:00
2018-03-17 22:39:21 +02:00
if (!Error.captureStackTrace) {
// captureStackTrace is only available when debugging
Error.captureStackTrace = () => {};
2018-03-17 20:43:34 +02:00
}
2018-03-17 22:39:21 +02:00
const pkg = require('./package.json');
2018-05-06 18:12:14 +01:00
const appjson = require('./app.json');
2018-01-30 22:42:38 +00:00
// <DrawerItems {...props} />
2018-03-17 22:39:21 +02:00
const CustomDrawerContentComponent = props => (
2018-01-30 22:42:38 +00:00
<ScrollView>
2018-07-07 14:04:32 +01:00
<SafeAreaView style={styles.container} forceInset={{ top: 'always', horizontal: 'never' }}>
<Text onPress={() => props.navigation.navigate('About')} style={styles.heading}>
2018-03-17 22:39:21 +02:00
{' '}
2018-05-06 18:12:14 +01:00
{pkg.name} v{pkg.version} (build {appjson.expo.ios.buildNumber})
2018-03-17 22:39:21 +02:00
</Text>
2018-01-30 22:42:38 +00:00
</SafeAreaView>
</ScrollView>
2018-03-17 22:39:21 +02:00
);
2018-01-30 22:42:38 +00:00
2018-03-17 22:07:09 +02:00
CustomDrawerContentComponent.propTypes = {
navigation: PropTypes.shape({
2018-03-17 22:39:21 +02:00
navigate: PropTypes.func,
}),
};
2018-03-17 22:07:09 +02:00
2018-01-30 22:42:38 +00:00
const styles = StyleSheet.create({
container: {
marginTop: 20,
2018-03-17 22:39:21 +02:00
flex: 1,
2018-01-30 22:42:38 +00:00
},
heading: {
textAlign: 'center',
color: 'black',
fontWeight: 'bold',
2018-03-17 22:39:21 +02:00
fontSize: 20,
},
});
2018-01-30 22:42:38 +00:00
2018-03-17 22:39:21 +02:00
const TabsInDrawer = DrawerNavigator(
{
MainBottomTabs: {
screen: MainBottomTabs,
navigationOptions: {
drawer: () => ({
label: 'Tabs',
}),
},
},
2018-03-24 21:24:20 +00:00
Selftest: {
screen: Selftest,
navigationOptions: {},
2018-01-30 22:42:38 +00:00
},
2018-03-31 14:43:08 +01:00
About: {
screen: About,
navigationOptions: {},
},
2018-04-01 00:16:42 +01:00
PlausibleDeniability: {
screen: PlausibleDeniability,
navigationOptions: {},
},
2018-03-17 22:39:21 +02:00
},
{
contentComponent: CustomDrawerContentComponent,
drawerOpenRoute: 'DrawerOpen',
drawerCloseRoute: 'DrawerClose',
drawerToggleRoute: 'DrawerToggle',
},
);
2018-01-30 22:42:38 +00:00
2018-03-17 22:39:21 +02:00
export default TabsInDrawer;