BlueWallet/App.js
2018-03-18 03:11:54 +00:00

86 lines
2.0 KiB
JavaScript

/** @type {AppStorage} */
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'
require('./BlueApp')
if (!Error.captureStackTrace) { // captureStackTrace is only available when debugging
Error.captureStackTrace = () => {}
}
const pkg = require('./package.json')
// <DrawerItems {...props} />
const CustomDrawerContentComponent = (props) => (
<ScrollView>
<SafeAreaView style={styles.container} forceInset={{ top: 'always', horizontal: 'never' }}>
<Text onPress={() => props.navigation.navigate('AddWallet')} style={styles.heading}> {pkg.name} v{pkg.version}</Text>
</SafeAreaView>
</ScrollView>
)
CustomDrawerContentComponent.propTypes = {
navigation: PropTypes.shape({
navigate: PropTypes.func
})
}
const styles = StyleSheet.create({
container: {
marginTop: 20,
flex: 1
},
heading: {
textAlign: 'center',
color: 'black',
fontWeight: 'bold',
fontSize: 20
}
})
/* import scanQrWifLegacyAddress from './screen/wallets/scanQrWifLegacyAddress'
import scanQrWifSegwitP2SHAddress from './screen/wallets/scanQrWifSegwitP2SHAddress' */
const TabsInDrawer = DrawerNavigator({
MainBottomTabs: {
screen: MainBottomTabs,
navigationOptions: {
drawer: () => ({
label: 'Tabs'
})
}
}
/* SecondaryBottomTabs: {
screen: SecondaryBottomTabs,
path: 'chat/aaa',
navigationOptions: {
drawer: () => ({
label: 'SecondaryBottomTabs',
icon: ({ tintColor }) => (
<MaterialIcons
name="filter-2"
size={24}
style={{ color: tintColor }}
/>
),
}),
},
}, */
}, {
contentComponent: CustomDrawerContentComponent,
drawerOpenRoute: 'DrawerOpen',
drawerCloseRoute: 'DrawerClose',
drawerToggleRoute: 'DrawerToggle'
})
export default TabsInDrawer