Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { SafeAreaView, ScrollView, Dimensions , View} from 'react-native';
  3. import { createAppContainer} from 'react-navigation'
  4. import { createStackNavigator } from 'react-navigation-stack'
  5. import { createDrawerNavigator , DrawerNavigatorItems} from 'react-navigation-drawer'
  6. import AsyncStorage from '@react-native-community/async-storage'
  7.  
  8.  
  9. import { Button, Text } from 'native-base'
  10.  
  11. import PointofSaleNav from './subNav/PointofSaleNav';
  12.  
  13. import MainScreen from '../screen/memberscreen/MainScreen'
  14. import PaymentList from '../screen/memberscreen/PaymentList'
  15. import Help from '../screen/memberscreen/Help'
  16. import Setting from '../screen/memberscreen/Setting'
  17.  
  18.  
  19. import { gestureHandlerRootHOC } from 'react-native-gesture-handler'
  20. import CheckOut from '../screen/subscreen/submainsc/CheckOut';
  21. import FinalCheck from '../screen/subscreen/submainsc/subcheckout/FinalCheck'
  22. import CashPayment from '../screen/subscreen/submainsc/subcheckout/CashPayment'
  23.  
  24. import InputCustomer from '../screen/subscreen/submainsc/InputCustomer';
  25.  
  26.  
  27.  
  28. const width = Dimensions.get('window').width
  29.  
  30. _onPressLogout= async (props) => {
  31. try {
  32. await AsyncStorage.clear()
  33. props.navigation.navigate('GuestNavigator')
  34. }
  35. catch(e) {
  36. alert(e)
  37. };
  38.  
  39. }
  40.  
  41. const CustomDrawerComponent = (props) => (
  42. <SafeAreaView style={{flex : 1}}>
  43. <ScrollView>
  44. <DrawerNavigatorItems {...props} />
  45. </ScrollView>
  46. <View>
  47. <Button onPress={() => this._onPressLogout(props)}>
  48. <Text>Logout</Text>
  49. </Button>
  50. </View>
  51. </SafeAreaView>
  52. )
  53.  
  54. const PaymentNavigator = createStackNavigator({
  55. MainScreen : {
  56. screen : MainScreen,
  57. navigationOptions : {
  58. header : null
  59. }
  60. },
  61. CheckOut : {
  62. screen : CheckOut,
  63. navigationOptions : {
  64. header : null
  65. }
  66. },
  67. InputCustomer : {
  68. screen : InputCustomer,
  69. navigationOptions : {
  70. header : null
  71. }
  72. },
  73. FinalCheck : {
  74. screen : FinalCheck,
  75. navigationOptions : {
  76. header : null
  77. }
  78. },
  79. CashPayment : {
  80. screen : CashPayment,
  81. navigationOptions : {
  82. header : null
  83. }
  84. },
  85. })
  86.  
  87. const DrawerNavigator = createDrawerNavigator({
  88. Payment : {
  89. screen : PaymentNavigator,
  90. navigationOptions: {
  91. header: null
  92. }
  93. },
  94. PaymentList : {
  95. screen : PaymentList,
  96. navigationOptions : {
  97. header : null
  98. }
  99. },
  100. PointofSale : {
  101. screen : PointofSaleNav,
  102. navigationOptions :{
  103. header : null
  104. }
  105. },
  106. Help : {
  107. screen : Help
  108. },
  109. Setting : {
  110. screen : Setting
  111. }
  112. }, {
  113. contentComponent : CustomDrawerComponent,
  114. })
  115.  
  116. const MemberNavigator = createStackNavigator({
  117. SideBar : {
  118. screen : DrawerNavigator,
  119. navigationOptions : {
  120. header : null
  121. }
  122. }
  123. })
  124.  
  125. export default createAppContainer(MemberNavigator)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement