change editor open animation

This commit is contained in:
ammarahm-ed
2020-05-12 02:56:22 +05:00
parent 5199b2c82f
commit b2d20b127b
5 changed files with 33 additions and 17 deletions

View File

@@ -3,9 +3,7 @@ import {Modal, Text, TouchableOpacity, View} from 'react-native';
import {TextInput} from 'react-native-gesture-handler';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import {opacity, ph, pv, SIZE, WEIGHT} from '../../common/common';
import {getElevation, ToastEvent, db} from '../../utils/utils';
import {eSendEvent} from '../../services/eventManager';
import {eOnNewTopicAdded} from '../../services/events';
import {Toast} from '../Toast';
@@ -26,11 +24,13 @@ export class AddTopicDialog extends React.Component {
if (!this.title)
return ToastEvent.show('Title is required', 'error', 'local');
await db.notebooks.notebook(this.props.notebookID).topics.add(this.title);
if (!this.props.toEdit) {
await db.notebooks.notebook(this.props.notebookID).topics.add(this.title);
} else {
}
this.close();
eSendEvent(eOnNewTopicAdded);
ToastEvent.show('New topic added', 'success');
eSendEvent(eOnNewTopicAdded);
};
open() {
@@ -165,7 +165,7 @@ export class AddTopicDialog extends React.Component {
color: 'white',
fontSize: SIZE.sm,
}}>
Add
{toEdit ? 'Save' : 'Add'}
</Text>
</TouchableOpacity>