You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
2.0 KiB

7 years ago
import './shim.js';
import React from 'react';
import PropTypes from 'prop-types';
import { Text, ScrollView, StyleSheet } from 'react-native';
import { createDrawerNavigator, SafeAreaView } from 'react-navigation';
7 years ago
import MainBottomTabs from './MainBottomTabs';
7 years ago
import Selftest from './screen/selftest';
import About from './screen/about';
import PlausibleDeniability from './screen/plausibledeniability';
/** @type {AppStorage} */
7 years ago
require('./BlueApp');
7 years ago
if (!Error.captureStackTrace) {
// captureStackTrace is only available when debugging
Error.captureStackTrace = () => {};
}
7 years ago
const pkg = require('./package.json');
const appjson = require('./app.json');
7 years ago
// <DrawerItems {...props} />
7 years ago
const CustomDrawerContentComponent = props => (
7 years ago
<ScrollView>
<SafeAreaView style={styles.container} forceInset={{ top: 'always', horizontal: 'never' }}>
<Text onPress={() => props.navigation.navigate('About')} style={styles.heading}>
7 years ago
{' '}
{pkg.name} v{pkg.version} (build {appjson.expo.ios.buildNumber})
7 years ago
</Text>
7 years ago
</SafeAreaView>
</ScrollView>
7 years ago
);
7 years ago
CustomDrawerContentComponent.propTypes = {
navigation: PropTypes.shape({
7 years ago
navigate: PropTypes.func,
}),
};
7 years ago
const styles = StyleSheet.create({
container: {
marginTop: 20,
7 years ago
flex: 1,
7 years ago
},
heading: {
textAlign: 'center',
color: 'black',
fontWeight: 'bold',
7 years ago
fontSize: 20,
},
});
7 years ago
const TabsInDrawer = createDrawerNavigator(
7 years ago
{
MainBottomTabs: {
screen: MainBottomTabs,
navigationOptions: {
drawer: () => ({
label: 'Tabs',
}),
},
},
7 years ago
Selftest: {
screen: Selftest,
navigationOptions: {},
7 years ago
},
About: {
screen: About,
navigationOptions: {},
},
PlausibleDeniability: {
screen: PlausibleDeniability,
navigationOptions: {},
},
7 years ago
},
{
contentComponent: CustomDrawerContentComponent,
drawerOpenRoute: 'DrawerOpen',
drawerCloseRoute: 'DrawerClose',
drawerToggleRoute: 'DrawerToggle',
},
);
7 years ago
7 years ago
export default TabsInDrawer;