update ActionSheet method

This commit is contained in:
ammarahm-ed
2020-12-29 11:25:12 +05:00
parent d92a9775a8
commit ecae9f4ee7
7 changed files with 14 additions and 20 deletions

View File

@@ -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>

View File

@@ -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,
});

View File

@@ -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() {

View File

@@ -33,7 +33,7 @@ const ProgressDialog = () => {
setDialogData(data);
setVisible(true);
await sleep(1);
actionSheetRef.current?._setModalVisible(true);
actionSheetRef.current?.setModalVisible(true);
};
const close = () => {

View File

@@ -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,

View File

@@ -38,7 +38,7 @@ const RestoreDialog = () => {
const open = async () => {
setVisible(true);
await sleep(30);
actionSheetRef.current?._setModalVisible(true);
actionSheetRef.current?.setModalVisible(true);
};
const close = () => {

View File

@@ -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,