import React from 'react';
import { DrawerNavigator, NavigationActions, DrawerItems } from 'react-navigation';
import { View, Image, StyleSheet } from 'react-native';
import MainScreen from '../screens/MainScreen';
import DrawerMenu from './DrawerMenu';

const styles = StyleSheet.create({
  icon: {
    width: 25,
    height: 25,
    tintColor: 'black'
  }
});

export const ScreenNames = {
  HOME_SCREEN: 'Home',
  EXAMPLES_SCREEN: 'EXAMPLES',
  ABOUT_SCREEN: 'ABOUT',
  FILE_OPEN_SCREEN: 'OPEN',
  FILE_SAVE_AS_SCREEN: 'SAVE AS'
};

const drawerNavigatorConfig = {
  contentComponent: DrawerMenu,
  drawerWidth: 270
};

const DrawerIcon = ({ iconName }) => (
  <Image source={require(`../../assets/${iconName}-icon.png`)} style={styles.icon} />
);

export default DrawerNavigator(
  {
    [ScreenNames.HOME_SCREEN]: {
      screen: MainScreen,
      navigationOptions: () => ({
        drawerLabel: () => null
      })
    },
    [ScreenNames.FILE_OPEN_SCREEN]: {
      screen: MainScreen,
      navigationOptions: () => ({
        drawerIcon: () => <DrawerIcon iconName="open" />
      })
    },
    [ScreenNames.FILE_SAVE_AS_SCREEN]: {
      screen: MainScreen,
      navigationOptions: () => ({
        drawerIcon: () => <DrawerIcon iconName="open" />
      })
    },
    [ScreenNames.EXAMPLES_SCREEN]: {
      screen: MainScreen,
      navigationOptions: () => ({
        drawerIcon: () => <DrawerIcon iconName="open" />
      })
    },
    [ScreenNames.ABOUT_SCREEN]: {
      screen: MainScreen,
      navigationOptions: () => ({
        drawerIcon: () => <DrawerIcon iconName="open" />
      })
    }
  },
  drawerNavigatorConfig
);

@@ -620,137 +620,8 @@
 %7D;%0A%0A
-const DrawerIcon = (%7B iconName %7D) =%3E (%0A  %3CImage source=%7Brequire(%60../../assets/$%7BiconName%7D-icon.png%60)%7D style=%7Bstyles.icon%7D /%3E%0A);%0A%0A
 expo
@@ -922,34 +922,80 @@
 =%3E %3C
-DrawerIcon iconName=%22open%22
+Image source=%7Brequire('../../assets/open-icon.png')%7D style=%7Bstyles.icon%7D
  /%3E%0A
@@ -1142,34 +1142,80 @@
 =%3E %3C
-DrawerIcon iconName=%22open%22
+Image source=%7Brequire('../../assets/save-icon.png')%7D style=%7Bstyles.icon%7D
  /%3E%0A
@@ -1358,34 +1358,84 @@
 =%3E %3C
-DrawerIcon iconName=%22open%22
+Image source=%7Brequire('../../assets/examples-icon.png')%7D style=%7Bstyles.icon%7D
  /%3E%0A
@@ -1575,34 +1575,81 @@
 =%3E %3C
-DrawerIcon iconName=%22open%22
+Image source=%7Brequire('../../assets/about-icon.png')%7D style=%7Bstyles.icon%7D
  /%3E%0A

Fix broken icons