Advertisement
Guest User

Untitled

a guest
Nov 18th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, {Component} from "react";
  2. import { Image, Button,StyleSheet, Dimensions ,TouchableHighlight, Linking } from "react-native";
  3.  
  4. import { TabNavigator,DrawerNavigator, StackNavigator } from "react-navigation"; //IDAN
  5. import DashboardScreen from "../views/Dashboard";
  6. import ContactScreen from "../views/Contacts/Contacts";
  7. import ChatScreen from "../views/chat/ChatView";
  8. import ProfileScreen from "../views/profile/ProfileView";
  9. //import HospitalScreen from "../views/hospitalList/HospitalList";
  10. import HospitalScreen from'./HospitalSearch';
  11.  
  12. import Icon from "react-native-vector-icons/FontAwesome";
  13. import Screen1 from "../components/Screen1"; //IDAN
  14. import Screen2 from "../components/Screen2"; //IDAN
  15. import HelpScreen from "../components/Help"; //IDAN
  16. const { width } = Dimensions.get('screen'); //IDAN
  17.  
  18. const styles = StyleSheet.create({
  19.   icon: {
  20.     height: 24,
  21.     width: 24,
  22.     backgroundColor: "transparent"
  23.   }
  24. });
  25.  
  26. const LoggedInNavigator = TabNavigator(
  27.   {
  28.     Contacts: {
  29.       screen: ContactScreen,
  30.       navigationOptions: {
  31.         tabBarIcon: ({ tintColor }) => (
  32.           <Image
  33.             source={require("../images/phone_icon.png")}
  34.             style={[styles.icon, { tintColor }]}
  35.           />
  36.         )
  37.       }
  38.     },
  39.     Chat: {
  40.       screen: ChatScreen,
  41.       navigationOptions: {
  42.         tabBarIcon: ({ tintColor }) => (
  43.           <Image
  44.             source={require("../images/chat_icon.png")}
  45.             style={[styles.icon, { tintColor }]}
  46.           />
  47.         )
  48.       }
  49.     },
  50.     Dashbaord: {
  51.       screen: DashboardScreen,
  52.       navigationOptions: {
  53.         tabBarIcon: ({ tintColor }) => (
  54.           <Image
  55.             source={require("../images/home_icon.png")}
  56.             style={[styles.icon, { tintColor }]}
  57.           />
  58.         )
  59.       }
  60.     },
  61.     Profile: {
  62.       screen: ProfileScreen,
  63.       navigationOptions: {
  64.         tabBarIcon: ({ tintColor }) => (
  65.           <Image
  66.             source={require("../images/social_icon.png")}
  67.             style={[styles.icon, { tintColor }]}
  68.           />
  69.         )
  70.       }
  71.     },
  72.     Search: {
  73.       screen: HospitalScreen,
  74.       navigationOptions: {
  75.         header:null,
  76.         tabBarIcon: ({ tintColor }) => (
  77.           <Image
  78.             source={require("../images/search_icon.png")}
  79.             style={[styles.icon, { tintColor }]}
  80.           />
  81.         )
  82.       }
  83.     }
  84.   },
  85.   {
  86.     initialRouteName: "Contacts",
  87.     tabBarPosition: "bottom",
  88.     swipeEnabled: false,
  89.     showLabel: false,
  90.     tabBarOptions: {
  91.       showIcon: true,
  92.       showLabel: false,
  93.       style: {
  94.         backgroundColor: "white"
  95.       },
  96.       activeTintColor: 'white',
  97.       inactiveTintColor: 'black',
  98.       indicatorStyle: {
  99.         backgroundColor: 'red',
  100.         borderRadius: 43/2,
  101.         height: 43,
  102.         position: 'relative',
  103.         top: 3
  104.       },
  105.     }
  106.   }
  107. );
  108.  
  109.  
  110.  
  111. // export default () => <Drawer onNavigationStateChange={null} />
  112.  
  113. const testStack = StackNavigator({
  114.   htest:{
  115.     screen: LoggedInNavigator,
  116.     headerMode: 'none',
  117.     header: null,
  118.     navigationOptions: {
  119.       header: null,
  120.     },
  121.   },}
  122. )
  123.  
  124.  const Drawer = DrawerNavigator ({
  125.   HomeTabs:{
  126.     screen: LoggedInNavigator,
  127.   },  
  128.   Home:{
  129.     screen: ContactScreen,
  130.     navigationOptions: {
  131.         drawerLabel: 'בית',
  132.         drawerIcon: ({ tintColor }) => <Icon name="home" size={24} />
  133.       },
  134.   },  
  135.   Facebook: {
  136.     screen: () => { Linking.openURL('https://www.facebook.com/StartAchCom/').catch(err => console.error('An error occurred', err)); return null},
  137.     navigationOptions: {
  138.         drawerLabel: 'מהפכה של שמחה',
  139.         drawerIcon: ({ tintColor }) => <Icon name="facebook" size={24} />
  140.       },
  141.   },
  142.   Facebook: {
  143.     screen: () => { Linking.openURL('https://www.facebook.com/StartAchCom/').catch(err => console.error('An error occurred', err)); return null},
  144.     navigationOptions: {
  145.         drawerLabel: 'סטארט-אח',
  146.         drawerIcon: ({ tintColor }) => <Icon name="facebook" size={24} />
  147.       },
  148.   },
  149.   Profile:{
  150.     screen: ProfileScreen,
  151.     navigationOptions: {
  152.         drawerLabel: "פרופיל",
  153.         drawerIcon: ({ tintColor }) => <Icon name="user" size={24} />
  154.       },
  155.   },  
  156.   Help:{
  157.     screen: HelpScreen,
  158.     navigationOptions: {
  159.         drawerLabel: 'עזרה',
  160.         drawerIcon: ({ tintColor }) => <Icon name="info" size={24} />
  161.       },
  162.   },  
  163.  
  164. },
  165. {
  166.   drawerWidth: width/1.5
  167. }
  168. );
  169.  
  170.  
  171. class Root extends Component {
  172.   render(){
  173.     return(
  174.       <Drawer>
  175.  
  176.       </Drawer>
  177.     )
  178.   }
  179.    
  180. }
  181. export default Root;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement