Настройте DrawerOpen и DrawerClose с помощью встроенной панели действий - PullRequest
0 голосов
/ 17 октября 2018

Я новичок в реагировать на родной процесс, пытаясь реализовать меню Drawer в реагирующем родном-action-bar, но он не работает.

Мой файл App.js здесь:

import React, {Component} from 'react';
import {View, StyleSheet} from 'react-native';
import { createDrawerNavigator } from 'react-navigation';

import Test from './src/pages/Test';
import Login from './src/pages/Login';
import Signup from './src/pages/customer/Signup';
import Forgot from './src/pages/Forgot';
import Profile from './src/pages/Profile';
import ChangePassword from './src/pages/ChangePassword';
import LocationPicker from './src/components/LocationPicker';
import Gallery from './src/pages/Gallery';
import Categories from './src/pages/Categories';

type Props = {};
export default class App extends Component<Props> {
  render() {
    return (
      <AppStackNavigator />
    );
  }
}

const AppStackNavigator = createDrawerNavigator({
  Test: Test,
  Gallery: Gallery,
  Categories: Categories,
  ChangePassword: ChangePassword,
  Login: Login,
  Registration: Signup,
  Forgot: Forgot,
  Profile: Profile,
  LocationPicker: LocationPicker,
});

ИЯ звоню в файл Test.js, который автоматически вызывается из кода App.js

Test.js здесь:

import React, { Component } from "react";
import {View, ScrollView, Text, StyleSheet } from 'react-native';
import { Icon } from 'react-native-elements';
import ActionBar from 'react-native-action-bar';
import { Drawer } from '../components/Navigators';


export default  class Test extends Component {
  constructor(props) {
    super(props)
  }
  render() {
    return (

      <View>
        <ActionBar
          containerStyle={{height:60}}
          backgroundColor={'black'}
          title={'Gallery'}
          leftIconName={'menu'}
          onLeftPress={() => {this.props.navigation.navigate('DrawerOpen'); } }
          titleStyle={styles.pageTitle}
        />
        <Text>Test</Text>

      </View>
    );
  }
}

Пожалуйста, кто-нибудь может помочь мне в этом, что будет заметно ..Спасибо!

...