'import React, { Component } from 'react';
import { StyleSheet, View, Text,TouchableOpacity,Image } from 'react-native';import NavigationDrawerLayout from
'реагировать-родной-навигация-макет ящика'; импортировать Tab_View_Example из "./Tab_View_Example";import Validation from" ./Validation";import Check_box from "./Check_box";import Drop_Down_Searchableиз.экспортный класс по умолчанию Navigation_Drawer extends React.Component {constructor () {super ();this.state = {menu: '', type: ''};} render () {return ({this.setState ({menu: e.title}); if (e.name === 'opt0') {alert ("Title:" + e.title + "-" + "Name:" + e.name); console.log ('Menu:', e);} else if (e.name == 'opt1') {console.log ('Menu:', e);} иначе if (e.name == 'opt2') {console.log ('Menu:', e);} еще if (e.name == 'opt3') {// имя класса - Validation.console.log ('Menu:', e);}}}> Ахмедабад);}} const styles = StyleSheet.create ({});'
// NavigationDrawerLayout import * as React из'act';импортировать текст, ScrollView, вид, таблицу стилей, DrawerLayoutAndroid,
Dimensions, ImageBackground, Image, TouchableNativeFeedback, Platform, StatusBar,} из «response-native»; импортировать значок из «Reaction-native-vector-icons / MaterialIcons '; импортIcon2 из'act-native-vector-icons / FontAwesome '; импортировать * как Animatable из'act-native-animatable';const AnimatedIcon = Animatable.createAnimatableComponent (Icon2);// var {width} = Dimensions.get ('window'); импортировать AvatarSocial из'act-native-avatar-social '; импортировать коллапс из' Reaction-native-Collapsing ';проверка импорта из "../../Components/Validation";const RippleColor = (... args) => Platform.Version> = 21?TouchableNativeFeedback.Ripple (... args): null; const Animations = {rotateTop: {0: {rotate: '0deg',}, 1: {rotate: -180deg ',},}, rotateBottom: {0: {rotate: '0deg',}, 1: {rotate: '180deg',},},};класс по умолчанию для экспорта NavigationDrawerLayout extends React.Component {constructor (props) {super (props); this.state = {account: this.props.account, firstAccount: [], width: Dimensions.get ('window'). width,selected: this.props.selected, window: this.props.window,}; this.openDrawer = this.openDrawer.bind (this);} onLayout (e) {const {width, height} = Dimensions.get ('window'); console.log (ширина, высота); this.setState ({ширина});} openDrawer () {this.drawer.openDrawer ();} closeDrawer () {this.drawer.closeDrawer ();} componentWillMount () {Animatable.initializeRegistryWithDefinitions ({rotateTop: Animations.rotateTop, rotateBottom: Animations.rotateBott);} componentDidMount () {this.openDrawer (); const {window} = this.state; const {type} = this.props;} viewBackground (el) {return {backgroundColor: this.state.selected == el.name?el.backgroundFocus: l.background,};} textColor (el) {return {color: this.state.selected == el.name?el.colorTextFocus: el.colorText,};} _ selected = e => {this.setState ({selected: e.name});this.props.onPress (e); if (e.close == true) this.closeDrawer ()};colorIcon (el) {вернуть this.state.selected == el.name?el.colorIconFocus: el.colorIcon;} badgeFunction = e => {вернуть this.props.badgeFunction?this.props.badgeFunction (e): e;}; hexToRgb (hex) {var result = / ^ #? ([af \ d] {2}) ([af \ d] {2}) ([af \ d] {2}) $ / i.exec (hex); вернуть результат?{r: parseInt (результат [1], 16), g: parseInt (результат [2], 16), b: parseInt (результат [3], 16),}: null;} render () {var {children,color, backgroundColor, imageBackground, аккаунт, процент, меню, тип, statusBar, statusBarTransparency,} = this.props;var ящик шириной = (this.state.width * процент) / 100; var firstAccount = this.state.firstAccount; var rgb = this.hexToRgb (statusBar? statusBar: '# 000000'); var barTransparency = statusBarTransparency?statusBarTransparency: 0.5; var StatusBarColor = 'rgba (' + rgb.r + ',' + rgb.g + ',' + rgb.b + ',' + barTransparency + ')'; var boxPosition = this.props.drawerPosition== 'правильно'?DrawerLayoutAndroid.positions.Right:DrawerLayoutAndroid.positions.Left; var list = ({menu.map ((e, i) => {if (e.type == 'divider') return (); остальное if (e.type == 'title')return ({e.title}); иначе if (e.type == 'menu') return (this._selected (e)} delayPressIn = {0} delayPressOut = {0} useForeground = {true} background = {RippleColor ('#ccc')}> {e.title} {e.badgeText && ({this.badgeFunction (e.badgeText)})});})});var navigationView = ({type! = 'simple' && ()} {this.state.window == 'account'? accountList: list}); return ((this.drawer = _drawer)} hookPosition = {boxPosition} renderNavigationView ={() => navigationView}> {children});}} const styles = StyleSheet.create ({}); '// 'Я хочу перейти к другому занятию класса из Navigation_Drawer, с помощью меню, например: menu: opt1'.