Majorchamp

Untitled

Mar 19th, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from 'react';
  2. import NavigationDrawer from 'react-md/lib/NavigationDrawers';
  3. import MyAwesomeComponent from './MyAwesomeComponent';
  4. import inboxListItems from './shared/constants/inboxListItems';
  5. import Avatar from 'react-md/lib/Avatars';
  6.  
  7. import randomImage from './shared/utils/RandomUtils/randomImage';
  8. import LoremIpsum from './shared/components/LoremIpsum';
  9. const avatarSrc = randomImage();
  10.  
  11. const drawerHeaderChildren = [
  12.   <Avatar
  13.     key={avatarSrc}
  14.     src={avatarSrc}
  15.     role="presentation"
  16.     iconSized
  17.     style={{ alignSelf: 'center', marginLeft: 16, marginRight: 16, flexShrink: 0 }}
  18.   />,
  19. ];
  20.  
  21. class NavDrawer extends Component {
  22.  
  23.   constructor(props) {
  24.      super(props);
  25.      this._navItems = inboxListItems.map(item => {
  26.       if (!item.divider) {
  27.         item.onClick = () => this._setPage(item.key);
  28.       }
  29.       return item;
  30.     });
  31.   }
  32.  
  33.   render() {
  34.     return (
  35.       <NavigationDrawer
  36.         navItems={this._navItems}
  37.         drawerType="PERSISTENT_MINI"
  38.         drawerTitle="Test"
  39.       >
  40.       <MyAwesomeComponent />
  41.       </NavigationDrawer>
  42.     );
  43.   }
  44. }
  45.  
  46. export default NavDrawer;
Advertisement
Add Comment
Please, Sign In to add comment