react-native-elements
Version:
React Native Elements & UI Toolkit
66 lines (60 loc) • 1.62 kB
JavaScript
import Expo from 'expo';
import React from 'react';
import { View, Image, Dimensions } from 'react-native';
import { DrawerNavigator, DrawerItems } from 'react-navigation';
import { Icon } from 'react-native-elements';
import Home from './src/drawer/home';
import SwipeDecker from './src/drawer/swipe_decker';
import Ratings from './src/drawer/ratings';
import Pricing from './src/drawer/pricing';
const SCREEN_WIDTH = Dimensions.get('window').width;
const CustomDrawerContentComponent = props => (
<View style={{ flex: 1, backgroundColor: '#43484d' }}>
<View
style={{ marginTop: 40, justifyContent: 'center', alignItems: 'center' }}
>
<Image
source={require('./src/images/logo.png')}
style={{ width: SCREEN_WIDTH * 0.57 }}
resizeMode="contain"
/>
</View>
<DrawerItems {...props} />
</View>
);
const MainRoot = DrawerNavigator(
{
Home: {
path: '/home',
screen: Home,
},
SwipeDecker: {
path: '/swiper_decker',
screen: SwipeDecker,
},
Ratings: {
path: '/ratings',
screen: Ratings,
},
Pricing: {
path: '/pricing',
screen: Pricing,
},
},
{
initialRouteName: 'Home',
contentOptions: {
activeTintColor: '#548ff7',
activeBackgroundColor: 'transparent',
inactiveTintColor: '#ffffff',
inactiveBackgroundColor: 'transparent',
labelStyle: {
fontSize: 15,
marginLeft: 0,
},
},
drawerWidth: SCREEN_WIDTH * 0.8,
contentComponent: CustomDrawerContentComponent,
}
);
Expo.registerRootComponent(MainRoot);