import React, {createRef} from 'react'; import {Modal, TouchableOpacity, View} from 'react-native'; import * as Animatable from 'react-native-animatable'; import {ACTIONS} from '../../provider/actions'; import {eSendEvent} from '../../services/eventManager'; import {eMoveNoteDialogNavigateBack} from '../../services/events'; import {getElevation, DDS} from '../../utils/utils'; import Folders from '../../views/Folders'; import Notebook from '../../views/Notebook'; import Notes from '../../views/Notes'; import {updateEvent} from '../DialogManager/recievers'; import {NavigationContainer} from '@react-navigation/native'; import {createStackNavigator} from '@react-navigation/stack'; const Stack = createStackNavigator(); const modalNavigatorRef = createRef(); const ModalNavigator = ({onStateChange}) => { return ( ); }; class MoveNoteDialog extends React.Component { constructor(props) { super(props); this.state = { visible: false, animated: false, }; this.routeIndex = 0; this.count = 0; } open() { this.setState({ visible: true, }); } close() { updateEvent({type: ACTIONS.CLEAR_SELECTION}); updateEvent({type: ACTIONS.MODAL_NAVIGATOR, enabled: false}); this.setState({ visible: false, animated: false, }); } render() { const {visible, animated} = this.state; const {colors} = this.props; return ( { updateEvent({type: ACTIONS.MODAL_NAVIGATOR, enabled: true}); this.setState({ animated: true, }); }} onRequestClose={() => { if (!this.routeIndex || this.routeIndex === 0) { this.close(); } else { eSendEvent(eMoveNoteDialogNavigateBack); } }} visible={visible} transparent={true}> this.close()} style={{ width: '100%', height: '100%', position: 'absolute', zIndex: 1, }} /> { this.routeIndex = event.index; }} /> ); } } export default MoveNoteDialog;