mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 06:59:31 +01:00
update ActionSheet method
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import React, {Component, createRef} from 'react';
|
||||
import {Platform} from 'react-native';
|
||||
import {DDS} from '../../services/DeviceDetection';
|
||||
import {
|
||||
eSendEvent,
|
||||
eSubscribeEvent,
|
||||
@@ -8,11 +6,9 @@ import {
|
||||
openVault,
|
||||
} from '../../services/EventManager';
|
||||
import {dWidth} from '../../utils';
|
||||
import {hexToRGBA} from '../../utils/ColorUtils';
|
||||
import {
|
||||
eCloseActionSheet,
|
||||
eCloseAddNotebookDialog,
|
||||
eCloseAddTopicDialog,
|
||||
eCloseLoginDialog,
|
||||
eCloseMoveNoteDialog,
|
||||
eClosePremiumDialog,
|
||||
@@ -20,17 +16,15 @@ import {
|
||||
eOnLoadNote,
|
||||
eOpenActionSheet,
|
||||
eOpenAddNotebookDialog,
|
||||
eOpenAddTopicDialog,
|
||||
eOpenExportDialog,
|
||||
eOpenLoginDialog,
|
||||
eOpenMoveNoteDialog,
|
||||
eOpenPremiumDialog,
|
||||
eOpenSimpleDialog,
|
||||
} from '../../utils/Events';
|
||||
import ActionSheet from '../ActionSheet';
|
||||
import {ActionSheetComponent} from '../ActionSheetComponent';
|
||||
import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';
|
||||
import {GetPremium, translatePrem} from '../ActionSheetComponent/GetPremium';
|
||||
import {translatePrem} from '../ActionSheetComponent/GetPremium';
|
||||
import {AddNotebookDialog} from '../AddNotebookDialog';
|
||||
import {AddTopicDialog} from '../AddTopicDialog';
|
||||
import {Dialog} from '../Dialog';
|
||||
@@ -90,13 +84,13 @@ export class DialogManager extends Component {
|
||||
actionSheetVisible: true,
|
||||
},
|
||||
() => {
|
||||
this.actionSheet.current?._setModalVisible();
|
||||
this.actionSheet.current?.setModalVisible();
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
_hideActionSheet = () => {
|
||||
this.actionSheet.current?._setModalVisible(false);
|
||||
this.actionSheet.current?.setModalVisible(false);
|
||||
};
|
||||
|
||||
_showMoveNote = () => {
|
||||
@@ -330,7 +324,7 @@ export class DialogManager extends Component {
|
||||
if (value) {
|
||||
this.show = value;
|
||||
}
|
||||
this.actionSheet.current?._setModalVisible();
|
||||
this.actionSheet.current?.setModalVisible();
|
||||
}}
|
||||
/>
|
||||
</ActionSheetWrapper>
|
||||
|
||||
@@ -20,7 +20,7 @@ class PendingDialog extends React.Component {
|
||||
}
|
||||
|
||||
async open() {
|
||||
actionSheet.current?._setModalVisible(true);
|
||||
actionSheet.current?.setModalVisible(true);
|
||||
let u = await db.user.fetchUser();
|
||||
this.setState({
|
||||
user: u && u.Id ? u : null,
|
||||
@@ -28,7 +28,7 @@ class PendingDialog extends React.Component {
|
||||
}
|
||||
|
||||
close() {
|
||||
actionSheet.current?._setModalVisible(false);
|
||||
actionSheet.current?.setModalVisible(false);
|
||||
this.setState({
|
||||
user: null,
|
||||
});
|
||||
|
||||
@@ -35,13 +35,13 @@ class PremiumDialog extends React.Component {
|
||||
visible: true,
|
||||
},
|
||||
() => {
|
||||
this.actionSheetRef.current?._setModalVisible(true);
|
||||
this.actionSheetRef.current?.setModalVisible(true);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
close() {
|
||||
this.actionSheetRef.current?._setModalVisible(false);
|
||||
this.actionSheetRef.current?.setModalVisible(false);
|
||||
}
|
||||
|
||||
async getSkus() {
|
||||
|
||||
@@ -33,7 +33,7 @@ const ProgressDialog = () => {
|
||||
setDialogData(data);
|
||||
setVisible(true);
|
||||
await sleep(1);
|
||||
actionSheetRef.current?._setModalVisible(true);
|
||||
actionSheetRef.current?.setModalVisible(true);
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
|
||||
@@ -46,13 +46,13 @@ class RecoveryKeyDialog extends React.Component {
|
||||
visible: true,
|
||||
},
|
||||
() => {
|
||||
this.actionSheetRef.current?._setModalVisible(true);
|
||||
this.actionSheetRef.current?.setModalVisible(true);
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
close = () => {
|
||||
this.actionSheetRef.current?._setModalVisible(false);
|
||||
this.actionSheetRef.current?.setModalVisible(false);
|
||||
sleep(200).then(() => {
|
||||
this.setState({
|
||||
visible: false,
|
||||
|
||||
@@ -38,7 +38,7 @@ const RestoreDialog = () => {
|
||||
const open = async () => {
|
||||
setVisible(true);
|
||||
await sleep(30);
|
||||
actionSheetRef.current?._setModalVisible(true);
|
||||
actionSheetRef.current?.setModalVisible(true);
|
||||
};
|
||||
|
||||
const close = () => {
|
||||
|
||||
@@ -34,7 +34,7 @@ class SortDialog extends React.Component {
|
||||
visible: true,
|
||||
},
|
||||
async () => {
|
||||
actionSheet.current?._setModalVisible(true);
|
||||
actionSheet.current?.setModalVisible(true);
|
||||
await this.getSettings();
|
||||
},
|
||||
);
|
||||
@@ -48,7 +48,7 @@ class SortDialog extends React.Component {
|
||||
}
|
||||
|
||||
close() {
|
||||
actionSheet.current?._setModalVisible(false);
|
||||
actionSheet.current?.setModalVisible(false);
|
||||
sleep(200).then(() => {
|
||||
this.setState({
|
||||
visible: false,
|
||||
|
||||
Reference in New Issue
Block a user