BlueWallet/App.js

84 lines
1.8 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-17 20:43:34 +02:00
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-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-03-17 22:39:21 +02:00
<SafeAreaView
style={styles.container}
forceInset={{ top: 'always', horizontal: 'never' }}
>
<Text
onPress={() => props.navigation.navigate('AddWallet')}
style={styles.heading}
>
{' '}
{pkg.name} v{pkg.version}
</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
/* import scanQrWifLegacyAddress from './screen/wallets/scanQrWifLegacyAddress'
import scanQrWifSegwitP2SHAddress from './screen/wallets/scanQrWifSegwitP2SHAddress' */
2018-03-17 22:39:21 +02:00
const TabsInDrawer = DrawerNavigator(
{
MainBottomTabs: {
screen: MainBottomTabs,
navigationOptions: {
drawer: () => ({
label: 'Tabs',
}),
},
},
2018-01-30 22:42:38 +00:00
2018-03-24 21:24:20 +00:00
Selftest: {
screen: Selftest,
navigationOptions: {},
2018-01-30 22:42:38 +00:00
},
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;