Advertisement
Guest User

Untitled

a guest
Oct 2nd, 2017
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. const DrawerContent = (props) => {
  2. return (
  3. <ScrollView style={styles.container}>
  4. <View
  5. style={styles.drawerHeader}
  6. >
  7. <Image
  8. style={{ width: responsiveHeight(10), height: responsiveHeight(10), borderRadius: 25 }}
  9. source={require('../res/img/profile/profile_default.jpg')}
  10. />
  11.  
  12. <View>
  13. <Text style={{ color: GLOBAL.COLOR.WHITE, fontSize: GLOBAL.FONT.SMALL }}>
  14. [##I WANT TO PUT STATE VALUE HERE##]
  15. </Text>
  16. <Text style={{ color: GLOBAL.COLOR.WHITE, fontSize: GLOBAL.FONT.SMALL }}>
  17. [##I WANT TO PUT STATE VALUE HERE##]
  18. </Text>
  19. </View>
  20.  
  21. </View>
  22. <DrawerItems {...props} />
  23. </ScrollView>
  24. );
  25. };
  26.  
  27. //Drawer Navigator for Members area Screen.
  28. const DrawerMenu = DrawerNavigator(
  29. {
  30. HomeScreen: {
  31. path: '/',
  32. screen: HomeView
  33. },
  34. ProfileScreen: {
  35. path: '/profile',
  36. screen: ProfileView
  37. },
  38. },
  39. {
  40. initialRouteName: 'HomeScreen',
  41. contentComponent: DrawerContent,
  42. contentOptions: {
  43. activeTintColor: GLOBAL.COLOR.PRIMARY,
  44. style: {
  45. zIndex: 100,
  46. //paddingTop: Platform.OS === 'ios' ? 20 : StatusBar.currentHeight
  47. }
  48. },
  49. }
  50. );
  51.  
  52. const initialState = {
  53. isLoggedIn: false,
  54. errorMsg: '',
  55. username: '', //THIS IS WHAT I NEED TO READ
  56. password: '',
  57. };
  58.  
  59. export default function login(state = initialState, action = {}) {
  60. switch (action.type) {
  61. case types.SUBMIT_LOGIN: {
  62. return {
  63. ...state,
  64. isLoggedIn: action.payload.loginStatus,
  65. username: action.payload.username,
  66. password: action.payload.password,
  67. errorMsg: action.payload.updatedErrMsg
  68. };
  69. }
  70. case types.CHANGE_USERNAME:
  71. return {
  72. ...state,
  73. username: action.username
  74. };
  75. case types.CHANGE_PASSWORD:
  76. return {
  77. ...state,
  78. password: action.password
  79. };
  80. default:
  81. return state;
  82. }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement