mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
fix edit topic dialog
This commit is contained in:
@@ -1,19 +1,24 @@
|
||||
import React, {createRef} from 'react';
|
||||
import {View} from 'react-native';
|
||||
import {TextInput} from 'react-native-gesture-handler';
|
||||
import {Actions} from '../../provider/Actions';
|
||||
import {DDS} from '../../services/DeviceDetection';
|
||||
import {eSendEvent, ToastEvent} from '../../services/EventManager';
|
||||
import {getElevation} from '../../utils';
|
||||
import {
|
||||
eSendEvent,
|
||||
eSubscribeEvent,
|
||||
eUnSubscribeEvent,
|
||||
ToastEvent,
|
||||
} from '../../services/EventManager';
|
||||
import {db} from '../../utils/DB';
|
||||
import {eOnNewTopicAdded} from '../../utils/Events';
|
||||
import {ph, pv, SIZE, WEIGHT} from '../../utils/SizeUtils';
|
||||
import {
|
||||
eCloseAddTopicDialog,
|
||||
eOnNewTopicAdded,
|
||||
eOpenAddTopicDialog,
|
||||
} from '../../utils/Events';
|
||||
import {SIZE, WEIGHT} from '../../utils/SizeUtils';
|
||||
import BaseDialog from '../Dialog/base-dialog';
|
||||
import DialogButtons from '../Dialog/dialog-buttons';
|
||||
import DialogContainer from '../Dialog/dialog-container';
|
||||
import DialogHeader from '../Dialog/dialog-header';
|
||||
import {updateEvent} from '../DialogManager/recievers';
|
||||
import Seperator from '../Seperator';
|
||||
import {Toast} from '../Toast';
|
||||
|
||||
export class AddTopicDialog extends React.Component {
|
||||
@@ -46,13 +51,22 @@ export class AddTopicDialog extends React.Component {
|
||||
eSendEvent(eOnNewTopicAdded);
|
||||
};
|
||||
|
||||
async open() {
|
||||
console.log(this.props.notebookID);
|
||||
this.notebook = await db.notebooks.notebook(this.props.notebookID);
|
||||
componentDidMount() {
|
||||
eSubscribeEvent(eOpenAddTopicDialog, this.open);
|
||||
eSubscribeEvent(eCloseAddTopicDialog, this.close);
|
||||
}
|
||||
componentWillUnmount() {
|
||||
eUnSubscribeEvent(eOpenAddTopicDialog, this.open);
|
||||
eUnSubscribeEvent(eCloseAddTopicDialog, this.close);
|
||||
}
|
||||
|
||||
open = async (notebookId) => {
|
||||
let id = notebookId || this.props.notebookID;
|
||||
this.notebook = await db.notebooks.notebook(id);
|
||||
this.setState({
|
||||
visible: true,
|
||||
});
|
||||
}
|
||||
};
|
||||
close = () => {
|
||||
this.title = null;
|
||||
this.setState({
|
||||
|
||||
@@ -147,8 +147,8 @@ export class DialogManager extends Component {
|
||||
eSubscribeEvent(eOpenAddNotebookDialog, this.showAddNotebook);
|
||||
eSubscribeEvent(eCloseAddNotebookDialog, this.hideAddNotebook);
|
||||
|
||||
eSubscribeEvent(eOpenAddTopicDialog, this.showAddTopic);
|
||||
eSubscribeEvent(eCloseAddTopicDialog, this.hideAddTopic);
|
||||
//eSubscribeEvent(eOpenAddTopicDialog, this.showAddTopic);
|
||||
//eSubscribeEvent(eCloseAddTopicDialog, this.hideAddTopic);
|
||||
|
||||
eSubscribeEvent(eOpenLoginDialog, this.showLoginDialog);
|
||||
eSubscribeEvent(eCloseLoginDialog, this.hideLoginDialog);
|
||||
@@ -172,8 +172,8 @@ export class DialogManager extends Component {
|
||||
eUnSubscribeEvent(eOpenAddNotebookDialog, this.showAddNotebook);
|
||||
eUnSubscribeEvent(eCloseAddNotebookDialog, this.hideAddNotebook);
|
||||
|
||||
eUnSubscribeEvent(eOpenAddTopicDialog, this.showAddTopic);
|
||||
eUnSubscribeEvent(eCloseAddTopicDialog, this.hideAddTopic);
|
||||
//eUnSubscribeEvent(eOpenAddTopicDialog, this.showAddTopic);
|
||||
//eUnSubscribeEvent(eCloseAddTopicDialog, this.hideAddTopic);
|
||||
|
||||
eUnSubscribeEvent(eOpenLoginDialog, this.showLoginDialog);
|
||||
eUnSubscribeEvent(eCloseLoginDialog, this.hideLoginDialog);
|
||||
|
||||
Reference in New Issue
Block a user