2020-01-16 19:52:45 +05:00
|
|
|
import React, {Component} from 'react';
|
|
|
|
|
import {DeviceEventEmitter} from 'react-native';
|
|
|
|
|
import ActionSheet from '../ActionSheet';
|
2020-01-18 01:04:33 +05:00
|
|
|
import {ActionSheetComponent} from '../ActionSheetComponent';
|
2020-01-17 11:49:31 +05:00
|
|
|
import {Dialog} from '../Dialog';
|
2020-01-17 21:05:38 +05:00
|
|
|
import {VaultDialog} from '../VaultDialog';
|
2020-01-18 18:14:34 +05:00
|
|
|
import MoveNoteDialog from '../MoveNoteDialog';
|
|
|
|
|
import {AddTopicDialog} from '../AddTopicDialog';
|
|
|
|
|
import {AddNotebookDialog} from '../AddNotebookDialog';
|
2020-01-22 02:50:25 +05:00
|
|
|
import {DDS} from '../../../App';
|
2020-01-23 23:18:15 +05:00
|
|
|
import LoginDialog from '../LoginDialog';
|
2020-01-25 12:05:20 +05:00
|
|
|
import {
|
|
|
|
|
eOpenActionSheet,
|
|
|
|
|
eCloseActionSheet,
|
|
|
|
|
eOpenSimpleDialog,
|
|
|
|
|
eCloseSimpleDialog,
|
|
|
|
|
eOpenMoveNoteDialog,
|
|
|
|
|
eCloseMoveNoteDialog,
|
|
|
|
|
eOpenAddNotebookDialog,
|
|
|
|
|
eCloseAddNotebookDialog,
|
|
|
|
|
eOpenAddTopicDialog,
|
|
|
|
|
eCloseAddTopicDialog,
|
|
|
|
|
eOpenLoginDialog,
|
|
|
|
|
eCloseLoginDialog,
|
|
|
|
|
eOnLoadNote,
|
|
|
|
|
eDispatchAction,
|
|
|
|
|
} from '../../services/events';
|
|
|
|
|
import {eUnSubscribeEvent, eSubscribeEvent} from '../../services/eventManager';
|
2020-01-18 11:41:42 +05:00
|
|
|
|
2020-01-22 02:50:25 +05:00
|
|
|
export const _recieveEvent = (eventName, action) => {
|
|
|
|
|
DeviceEventEmitter.addListener(eventName, action);
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
export const _UnSubscribeEvent = (eventName, action) => {
|
2020-01-22 02:50:25 +05:00
|
|
|
DeviceEventEmitter.removeListener(eventName, action);
|
|
|
|
|
};
|
2020-01-18 11:41:42 +05:00
|
|
|
export const dialogActions = {
|
|
|
|
|
ACTION_DELETE: 511,
|
|
|
|
|
ACTION_EXIT: 512,
|
|
|
|
|
ACTION_EMPTY_TRASH: 513,
|
2020-01-22 02:50:25 +05:00
|
|
|
ACTION_EXIT_FULLSCREEN: 514,
|
2020-01-18 11:41:42 +05:00
|
|
|
};
|
|
|
|
|
|
2020-01-18 18:14:34 +05:00
|
|
|
export const ActionSheetEvent = (
|
|
|
|
|
item,
|
|
|
|
|
colors,
|
|
|
|
|
tags,
|
|
|
|
|
rowItems,
|
|
|
|
|
columnItems,
|
|
|
|
|
extraData,
|
|
|
|
|
) => {
|
2020-01-25 12:05:20 +05:00
|
|
|
DeviceEventEmitter.emit(eOpenActionSheet, {
|
2020-01-16 19:52:45 +05:00
|
|
|
item,
|
|
|
|
|
colors,
|
|
|
|
|
tags,
|
|
|
|
|
rowItems,
|
|
|
|
|
columnItems,
|
2020-01-18 18:14:34 +05:00
|
|
|
extraData,
|
2020-01-16 19:52:45 +05:00
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
export const ActionSheetHideEvent = () => {
|
2020-01-25 12:05:20 +05:00
|
|
|
DeviceEventEmitter.emit(eCloseActionSheet);
|
2020-01-16 19:52:45 +05:00
|
|
|
};
|
|
|
|
|
|
2020-01-17 11:49:31 +05:00
|
|
|
export const simpleDialogEvent = data => {
|
2020-01-25 12:05:20 +05:00
|
|
|
DeviceEventEmitter.emit(eOpenSimpleDialog, data);
|
2020-01-17 11:49:31 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const simpleDialogHideEvent = () => {
|
2020-01-25 12:05:20 +05:00
|
|
|
DeviceEventEmitter.emit(eCloseSimpleDialog);
|
2020-01-17 11:49:31 +05:00
|
|
|
};
|
|
|
|
|
|
2020-01-18 18:14:34 +05:00
|
|
|
export const moveNoteEvent = () => {
|
2020-01-25 12:05:20 +05:00
|
|
|
DeviceEventEmitter.emit(eOpenMoveNoteDialog);
|
2020-01-18 18:14:34 +05:00
|
|
|
};
|
|
|
|
|
export const moveNoteHideEvent = () => {
|
2020-01-25 12:05:20 +05:00
|
|
|
DeviceEventEmitter.emit(eCloseMoveNoteDialog);
|
2020-01-18 18:14:34 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const AddNotebookEvent = notebook => {
|
2020-01-25 12:05:20 +05:00
|
|
|
DeviceEventEmitter.emit(eOpenAddNotebookDialog, {item: notebook});
|
2020-01-18 18:14:34 +05:00
|
|
|
};
|
|
|
|
|
export const HideAddNotebookEvent = notebook => {
|
2020-01-25 12:05:20 +05:00
|
|
|
DeviceEventEmitter.emit(eCloseAddNotebookDialog, notebook);
|
2020-01-18 18:14:34 +05:00
|
|
|
};
|
|
|
|
|
export const AddTopicEvent = notebook => {
|
2020-01-25 12:05:20 +05:00
|
|
|
DeviceEventEmitter.emit(eOpenAddTopicDialog, notebook);
|
2020-01-18 18:14:34 +05:00
|
|
|
};
|
|
|
|
|
export const HideAddTopicEvent = notebook => {
|
2020-01-25 12:05:20 +05:00
|
|
|
DeviceEventEmitter.emit(eCloseAddTopicDialog, notebook);
|
2020-01-18 18:14:34 +05:00
|
|
|
};
|
|
|
|
|
|
2020-01-17 11:49:31 +05:00
|
|
|
export const updateEvent = data => {
|
2020-01-25 12:05:20 +05:00
|
|
|
DeviceEventEmitter.emit(eDispatchAction, data);
|
2020-01-17 11:49:31 +05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const TEMPLATE_DELETE = type => {
|
|
|
|
|
return {
|
|
|
|
|
title: `Delete ${type}`,
|
|
|
|
|
paragraph: `Are you sure you want to delete this ${type}`,
|
|
|
|
|
positiveText: 'Delete',
|
|
|
|
|
negativeText: 'Cancel',
|
|
|
|
|
action: dialogActions.ACTION_DELETE,
|
|
|
|
|
icon: 'trash',
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-22 02:50:25 +05:00
|
|
|
export const TEMPLATE_EXIT_FULLSCREEN = () => {
|
|
|
|
|
return {
|
|
|
|
|
title: `Exit fullscreen editor?`,
|
|
|
|
|
paragraph: `Are you sure you want to exit fullscreen editor?`,
|
|
|
|
|
positiveText: 'Exit',
|
|
|
|
|
negativeText: 'Cancel',
|
|
|
|
|
action: dialogActions.ACTION_EXIT_FULLSCREEN,
|
|
|
|
|
icon: 'x',
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-17 21:05:38 +05:00
|
|
|
export const TEMPLATE_EXIT = type => {
|
|
|
|
|
return {
|
|
|
|
|
title: `Close ${type}`,
|
|
|
|
|
paragraph: `Are you sure you want to close ${type}`,
|
|
|
|
|
positiveText: `Close`,
|
|
|
|
|
negativeText: 'Cancel',
|
|
|
|
|
action: dialogActions.ACTION_EXIT,
|
|
|
|
|
icon: 'x',
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-18 00:46:29 +05:00
|
|
|
export const TEMPLATE_EMPTY_TRASH = {
|
|
|
|
|
title: 'Empty Trash',
|
|
|
|
|
paragraph: 'Are you sure you want to clear the trash?',
|
|
|
|
|
icon: 'trash',
|
|
|
|
|
positiveText: 'Clear',
|
|
|
|
|
negativeText: 'Cancel',
|
|
|
|
|
action: dialogActions.ACTION_EMPTY_TRASH,
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-16 19:52:45 +05:00
|
|
|
export class DialogManager extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
this.actionSheet;
|
2020-01-17 21:05:38 +05:00
|
|
|
this.opened = false;
|
2020-01-16 19:52:45 +05:00
|
|
|
this.state = {
|
|
|
|
|
item: {},
|
|
|
|
|
actionSheetData: {
|
|
|
|
|
colors: false,
|
|
|
|
|
tags: false,
|
|
|
|
|
rowItems: [],
|
|
|
|
|
columnItems: [],
|
|
|
|
|
},
|
2020-01-17 11:49:31 +05:00
|
|
|
simpleDialog: {
|
|
|
|
|
title: '',
|
|
|
|
|
paragraph: '',
|
|
|
|
|
positiveText: '',
|
|
|
|
|
negativeText: '',
|
|
|
|
|
action: 0,
|
|
|
|
|
icon: '',
|
|
|
|
|
},
|
2020-01-17 21:05:38 +05:00
|
|
|
isPerm: false,
|
2020-01-16 19:52:45 +05:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-17 21:05:38 +05:00
|
|
|
shouldComponentUpdate(nextProps, nextState) {
|
|
|
|
|
return (
|
|
|
|
|
JSON.stringify(nextProps) !== JSON.stringify(this.props) ||
|
|
|
|
|
nextState !== this.state
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-16 19:52:45 +05:00
|
|
|
_showActionSheet = data => {
|
|
|
|
|
this.setState(
|
|
|
|
|
{
|
|
|
|
|
actionSheetData: data,
|
|
|
|
|
item: data.item,
|
|
|
|
|
},
|
|
|
|
|
() => {
|
|
|
|
|
this.actionSheet._setModalVisible();
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_hideActionSheet = () => {
|
|
|
|
|
this.actionSheet._setModalVisible();
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-18 18:14:34 +05:00
|
|
|
_showMoveNote = () => {
|
|
|
|
|
this.moveNoteDialog.open();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
_hideMoveNote = () => {
|
|
|
|
|
this.moveNoteDialog.close();
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-22 02:50:25 +05:00
|
|
|
loadNote = i => {
|
|
|
|
|
if (i && i.type === 'new') {
|
2020-01-23 23:18:15 +05:00
|
|
|
this.setState({
|
|
|
|
|
note: {},
|
|
|
|
|
});
|
2020-01-22 02:50:25 +05:00
|
|
|
} else {
|
|
|
|
|
note = i;
|
|
|
|
|
this.setState({
|
|
|
|
|
item: i,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-16 19:52:45 +05:00
|
|
|
componentDidMount() {
|
2020-01-25 12:05:20 +05:00
|
|
|
eSubscribeEvent(eOnLoadNote, this.loadNote);
|
2020-01-17 11:49:31 +05:00
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
eSubscribeEvent(eOpenActionSheet, this._showActionSheet);
|
|
|
|
|
eSubscribeEvent(eCloseActionSheet, this._hideSimpleDialog);
|
2020-01-18 18:14:34 +05:00
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
eSubscribeEvent(eOpenSimpleDialog, this._showSimpleDialog);
|
|
|
|
|
eSubscribeEvent(eCloseSimpleDialog, this._hideSimpleDialog);
|
2020-01-18 18:14:34 +05:00
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
eSubscribeEvent(eOpenMoveNoteDialog, this._showMoveNote);
|
|
|
|
|
eSubscribeEvent(eCloseMoveNoteDialog, this._hideMoveNote);
|
2020-01-18 18:14:34 +05:00
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
eSubscribeEvent(eOpenAddNotebookDialog, this.showAddNotebook);
|
|
|
|
|
eSubscribeEvent(eCloseAddNotebookDialog, this.hideAddNotebook);
|
2020-01-23 23:18:15 +05:00
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
eSubscribeEvent(eOpenAddTopicDialog, this.showAddTopic);
|
|
|
|
|
eSubscribeEvent(eCloseAddTopicDialog, this.hideAddTopic);
|
|
|
|
|
|
|
|
|
|
eSubscribeEvent(eOpenLoginDialog, this.showLoginDialog);
|
|
|
|
|
eSubscribeEvent(eCloseLoginDialog, this.hideLoginDialog);
|
2020-01-16 19:52:45 +05:00
|
|
|
}
|
2020-01-23 23:18:15 +05:00
|
|
|
|
2020-01-16 19:52:45 +05:00
|
|
|
componentWillUnmount() {
|
2020-01-25 12:05:20 +05:00
|
|
|
eUnSubscribeEvent(eOnLoadNote, this.loadNote);
|
2020-01-22 02:50:25 +05:00
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
eUnSubscribeEvent(eOpenActionSheet, this._showActionSheet);
|
|
|
|
|
eUnSubscribeEvent(eCloseActionSheet, this._hideSimpleDialog);
|
2020-01-17 11:49:31 +05:00
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
eUnSubscribeEvent(eOpenSimpleDialog, this._showSimpleDialog);
|
|
|
|
|
eUnSubscribeEvent(eCloseSimpleDialog, this._hideSimpleDialog);
|
2020-01-18 18:14:34 +05:00
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
eUnSubscribeEvent(eOpenMoveNoteDialog, this._showMoveNote);
|
|
|
|
|
eUnSubscribeEvent(eCloseMoveNoteDialog, this._hideMoveNote);
|
2020-01-18 18:14:34 +05:00
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
eUnSubscribeEvent(eOpenAddNotebookDialog, this.showAddNotebook);
|
|
|
|
|
eUnSubscribeEvent(eCloseAddNotebookDialog, this.hideAddNotebook);
|
2020-01-18 18:14:34 +05:00
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
eUnSubscribeEvent(eOpenAddTopicDialog, this.showAddTopic);
|
|
|
|
|
eUnSubscribeEvent(eCloseAddTopicDialog, this.hideAddTopic);
|
2020-01-23 23:18:15 +05:00
|
|
|
|
2020-01-25 12:05:20 +05:00
|
|
|
eUnSubscribeEvent(eOpenLoginDialog, this.showLoginDialog);
|
|
|
|
|
eUnSubscribeEvent(eCloseLoginDialog, this.hideLoginDialog);
|
2020-01-18 18:14:34 +05:00
|
|
|
}
|
|
|
|
|
|
2020-01-23 23:18:15 +05:00
|
|
|
showLoginDialog = () => {
|
|
|
|
|
this.loginDialog.open();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
hideLoginDialog = () => {
|
|
|
|
|
this.loginDialog.close();
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-20 15:32:32 +05:00
|
|
|
showAddNotebook = data => {
|
2020-01-18 18:14:34 +05:00
|
|
|
this.setState(
|
|
|
|
|
{
|
2020-01-20 15:32:32 +05:00
|
|
|
item: data.item ? data.item : {},
|
2020-01-18 18:14:34 +05:00
|
|
|
},
|
|
|
|
|
() => {
|
2020-01-20 15:32:32 +05:00
|
|
|
this.addNotebooksDialog.open();
|
2020-01-18 18:14:34 +05:00
|
|
|
},
|
|
|
|
|
);
|
2020-01-20 15:32:32 +05:00
|
|
|
};
|
|
|
|
|
hideAddNotebook = () => {
|
|
|
|
|
this.addNotebooksDialog.close();
|
|
|
|
|
};
|
2020-01-18 18:14:34 +05:00
|
|
|
|
2020-01-20 15:32:32 +05:00
|
|
|
showAddTopic = () => {
|
2020-01-18 18:14:34 +05:00
|
|
|
this.setState({
|
|
|
|
|
item: notebook,
|
|
|
|
|
});
|
|
|
|
|
this.addTopicsDialog.open();
|
2020-01-20 15:32:32 +05:00
|
|
|
};
|
2020-01-18 18:14:34 +05:00
|
|
|
|
2020-01-20 15:32:32 +05:00
|
|
|
hideAddTopic = () => {
|
2020-01-18 18:14:34 +05:00
|
|
|
this.addTopicsDialog.close();
|
2020-01-20 15:32:32 +05:00
|
|
|
};
|
2020-01-16 19:52:45 +05:00
|
|
|
|
2020-01-17 11:49:31 +05:00
|
|
|
_showSimpleDialog = data => {
|
|
|
|
|
this.setState(
|
|
|
|
|
{
|
|
|
|
|
simpleDialog: data,
|
|
|
|
|
},
|
|
|
|
|
() => {
|
|
|
|
|
this.simpleDialog.show();
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
_hideSimpleDialog = data => {
|
|
|
|
|
this.simpleDialog.hide();
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-17 21:05:38 +05:00
|
|
|
_showVaultDialog = () => {
|
|
|
|
|
this.vaultDialogRef.open();
|
|
|
|
|
};
|
|
|
|
|
_hideVaultDialog = () => {
|
|
|
|
|
this.vaultDialogRef.close();
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-17 11:49:31 +05:00
|
|
|
onActionSheetHide = () => {
|
|
|
|
|
if (this.show) {
|
2020-01-18 18:14:34 +05:00
|
|
|
switch (this.show) {
|
|
|
|
|
case 'delete': {
|
|
|
|
|
this._showSimpleDialog(TEMPLATE_DELETE(this.state.item.type));
|
2020-01-19 21:31:26 +05:00
|
|
|
break;
|
2020-01-18 18:14:34 +05:00
|
|
|
}
|
|
|
|
|
case 'lock': {
|
|
|
|
|
this._showVaultDialog();
|
2020-01-19 21:31:26 +05:00
|
|
|
break;
|
2020-01-18 18:14:34 +05:00
|
|
|
}
|
|
|
|
|
case 'unlock': {
|
|
|
|
|
this.setState({
|
|
|
|
|
isPerm: true,
|
|
|
|
|
});
|
|
|
|
|
this._showVaultDialog();
|
2020-01-19 21:31:26 +05:00
|
|
|
break;
|
2020-01-18 18:14:34 +05:00
|
|
|
}
|
|
|
|
|
case 'notebook': {
|
2020-01-20 15:32:32 +05:00
|
|
|
this.showAddNotebook({item: this.state.item});
|
2020-01-19 21:31:26 +05:00
|
|
|
break;
|
2020-01-18 18:14:34 +05:00
|
|
|
}
|
|
|
|
|
case 'topic': {
|
|
|
|
|
this.showAddTOpic();
|
2020-01-19 21:31:26 +05:00
|
|
|
break;
|
2020-01-18 18:14:34 +05:00
|
|
|
}
|
2020-01-17 11:49:31 +05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.show = null;
|
|
|
|
|
};
|
|
|
|
|
|
2020-01-16 19:52:45 +05:00
|
|
|
render() {
|
2020-01-17 21:05:38 +05:00
|
|
|
let {colors} = this.props;
|
|
|
|
|
let {
|
|
|
|
|
actionSheetData,
|
|
|
|
|
item,
|
|
|
|
|
simpleDialog,
|
|
|
|
|
isPerm,
|
|
|
|
|
vaultDialog,
|
|
|
|
|
unlock,
|
|
|
|
|
} = this.state;
|
2020-01-16 19:52:45 +05:00
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<ActionSheet
|
|
|
|
|
ref={ref => (this.actionSheet = ref)}
|
2020-01-24 18:48:33 +05:00
|
|
|
containerStyle={{
|
2020-01-16 19:52:45 +05:00
|
|
|
backgroundColor: colors.bg,
|
2020-01-24 18:48:33 +05:00
|
|
|
width: DDS.isTab ? 500 : '100%',
|
|
|
|
|
alignSelf: DDS.isTab ? 'flex-end' : 'center',
|
|
|
|
|
marginRight: DDS.isTab ? 12 : null,
|
|
|
|
|
borderRadius: 10,
|
|
|
|
|
marginBottom: DDS.isTab ? 50 : 0,
|
2020-01-16 19:52:45 +05:00
|
|
|
}}
|
2020-01-24 18:48:33 +05:00
|
|
|
extraScroll={DDS.isTab ? 50 : 0}
|
2020-01-16 19:52:45 +05:00
|
|
|
indicatorColor={colors.shade}
|
2020-01-24 18:48:33 +05:00
|
|
|
footerAlwaysVisible={DDS.isTab}
|
|
|
|
|
footerHeight={DDS.isTab ? 20 : 80}
|
|
|
|
|
footerStyle={
|
|
|
|
|
DDS.isTab
|
|
|
|
|
? {
|
|
|
|
|
borderRadius: 10,
|
2020-01-24 23:13:09 +05:00
|
|
|
backgroundColor: colors.bg,
|
2020-01-24 18:48:33 +05:00
|
|
|
}
|
|
|
|
|
: null
|
|
|
|
|
}
|
|
|
|
|
initialOffsetFromBottom={DDS.isTab ? 1 : 0.5}
|
2020-01-16 19:52:45 +05:00
|
|
|
bounceOnOpen={true}
|
|
|
|
|
gestureEnabled={true}
|
|
|
|
|
onClose={() => {
|
2020-01-17 11:49:31 +05:00
|
|
|
this.onActionSheetHide();
|
2020-01-16 19:52:45 +05:00
|
|
|
}}>
|
|
|
|
|
<ActionSheetComponent
|
|
|
|
|
item={item}
|
|
|
|
|
setWillRefresh={value => {
|
|
|
|
|
this.willRefresh = true;
|
|
|
|
|
}}
|
|
|
|
|
hasColors={actionSheetData.colors}
|
|
|
|
|
hasTags={actionSheetData.colors}
|
|
|
|
|
overlayColor={
|
|
|
|
|
colors.night ? 'rgba(225,225,225,0.1)' : 'rgba(0,0,0,0.3)'
|
|
|
|
|
}
|
|
|
|
|
rowItems={actionSheetData.rowItems}
|
|
|
|
|
columnItems={actionSheetData.columnItems}
|
|
|
|
|
close={value => {
|
|
|
|
|
if (value) {
|
|
|
|
|
this.show = value;
|
|
|
|
|
}
|
|
|
|
|
this.actionSheet._setModalVisible();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</ActionSheet>
|
2020-01-17 11:49:31 +05:00
|
|
|
|
|
|
|
|
<Dialog
|
|
|
|
|
ref={ref => (this.simpleDialog = ref)}
|
|
|
|
|
item={item}
|
|
|
|
|
colors={colors}
|
|
|
|
|
template={simpleDialog}
|
|
|
|
|
/>
|
2020-01-17 21:05:38 +05:00
|
|
|
|
|
|
|
|
<VaultDialog
|
|
|
|
|
ref={ref => (this.vaultDialogRef = ref)}
|
|
|
|
|
colors={colors}
|
|
|
|
|
note={item}
|
|
|
|
|
perm={isPerm}
|
|
|
|
|
openedToUnlock={false}
|
|
|
|
|
visible={vaultDialog}
|
|
|
|
|
/>
|
2020-01-18 18:14:34 +05:00
|
|
|
|
|
|
|
|
<MoveNoteDialog
|
|
|
|
|
ref={ref => (this.moveNoteDialog = ref)}
|
|
|
|
|
colors={colors}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<AddTopicDialog
|
|
|
|
|
ref={ref => (this.addTopicsDialog = ref)}
|
|
|
|
|
toEdit={item}
|
|
|
|
|
notebookID={
|
|
|
|
|
actionSheetData.extraData
|
|
|
|
|
? actionSheetData.extraData.notebookID
|
|
|
|
|
: null
|
|
|
|
|
}
|
|
|
|
|
colors={colors}
|
|
|
|
|
/>
|
|
|
|
|
<AddNotebookDialog
|
|
|
|
|
ref={ref => (this.addNotebooksDialog = ref)}
|
|
|
|
|
toEdit={item}
|
|
|
|
|
colors={colors}
|
|
|
|
|
/>
|
2020-01-23 23:18:15 +05:00
|
|
|
|
|
|
|
|
<LoginDialog colors={colors} ref={ref => (this.loginDialog = ref)} />
|
2020-01-16 19:52:45 +05:00
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|