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 React, {Component, createRef} from 'react';
import {Platform} from 'react-native';
import {DDS} from '../../services/DeviceDetection';
import { import {
eSendEvent, eSendEvent,
eSubscribeEvent, eSubscribeEvent,
@@ -8,11 +6,9 @@ import {
openVault, openVault,
} from '../../services/EventManager'; } from '../../services/EventManager';
import {dWidth} from '../../utils'; import {dWidth} from '../../utils';
import {hexToRGBA} from '../../utils/ColorUtils';
import { import {
eCloseActionSheet, eCloseActionSheet,
eCloseAddNotebookDialog, eCloseAddNotebookDialog,
eCloseAddTopicDialog,
eCloseLoginDialog, eCloseLoginDialog,
eCloseMoveNoteDialog, eCloseMoveNoteDialog,
eClosePremiumDialog, eClosePremiumDialog,
@@ -20,17 +16,15 @@ import {
eOnLoadNote, eOnLoadNote,
eOpenActionSheet, eOpenActionSheet,
eOpenAddNotebookDialog, eOpenAddNotebookDialog,
eOpenAddTopicDialog,
eOpenExportDialog, eOpenExportDialog,
eOpenLoginDialog, eOpenLoginDialog,
eOpenMoveNoteDialog, eOpenMoveNoteDialog,
eOpenPremiumDialog, eOpenPremiumDialog,
eOpenSimpleDialog, eOpenSimpleDialog,
} from '../../utils/Events'; } from '../../utils/Events';
import ActionSheet from '../ActionSheet';
import {ActionSheetComponent} from '../ActionSheetComponent'; import {ActionSheetComponent} from '../ActionSheetComponent';
import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper'; import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';
import {GetPremium, translatePrem} from '../ActionSheetComponent/GetPremium'; import {translatePrem} from '../ActionSheetComponent/GetPremium';
import {AddNotebookDialog} from '../AddNotebookDialog'; import {AddNotebookDialog} from '../AddNotebookDialog';
import {AddTopicDialog} from '../AddTopicDialog'; import {AddTopicDialog} from '../AddTopicDialog';
import {Dialog} from '../Dialog'; import {Dialog} from '../Dialog';
@@ -90,13 +84,13 @@ export class DialogManager extends Component {
actionSheetVisible: true, actionSheetVisible: true,
}, },
() => { () => {
this.actionSheet.current?._setModalVisible(); this.actionSheet.current?.setModalVisible();
}, },
); );
}; };
_hideActionSheet = () => { _hideActionSheet = () => {
this.actionSheet.current?._setModalVisible(false); this.actionSheet.current?.setModalVisible(false);
}; };
_showMoveNote = () => { _showMoveNote = () => {
@@ -330,7 +324,7 @@ export class DialogManager extends Component {
if (value) { if (value) {
this.show = value; this.show = value;
} }
this.actionSheet.current?._setModalVisible(); this.actionSheet.current?.setModalVisible();
}} }}
/> />
</ActionSheetWrapper> </ActionSheetWrapper>

View File

@@ -20,7 +20,7 @@ class PendingDialog extends React.Component {
} }
async open() { async open() {
actionSheet.current?._setModalVisible(true); actionSheet.current?.setModalVisible(true);
let u = await db.user.fetchUser(); let u = await db.user.fetchUser();
this.setState({ this.setState({
user: u && u.Id ? u : null, user: u && u.Id ? u : null,
@@ -28,7 +28,7 @@ class PendingDialog extends React.Component {
} }
close() { close() {
actionSheet.current?._setModalVisible(false); actionSheet.current?.setModalVisible(false);
this.setState({ this.setState({
user: null, user: null,
}); });

View File

@@ -35,13 +35,13 @@ class PremiumDialog extends React.Component {
visible: true, visible: true,
}, },
() => { () => {
this.actionSheetRef.current?._setModalVisible(true); this.actionSheetRef.current?.setModalVisible(true);
}, },
); );
} }
close() { close() {
this.actionSheetRef.current?._setModalVisible(false); this.actionSheetRef.current?.setModalVisible(false);
} }
async getSkus() { async getSkus() {

View File

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

View File

@@ -46,13 +46,13 @@ class RecoveryKeyDialog extends React.Component {
visible: true, visible: true,
}, },
() => { () => {
this.actionSheetRef.current?._setModalVisible(true); this.actionSheetRef.current?.setModalVisible(true);
}, },
); );
}; };
close = () => { close = () => {
this.actionSheetRef.current?._setModalVisible(false); this.actionSheetRef.current?.setModalVisible(false);
sleep(200).then(() => { sleep(200).then(() => {
this.setState({ this.setState({
visible: false, visible: false,

View File

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

View File

@@ -34,7 +34,7 @@ class SortDialog extends React.Component {
visible: true, visible: true,
}, },
async () => { async () => {
actionSheet.current?._setModalVisible(true); actionSheet.current?.setModalVisible(true);
await this.getSettings(); await this.getSettings();
}, },
); );
@@ -48,7 +48,7 @@ class SortDialog extends React.Component {
} }
close() { close() {
actionSheet.current?._setModalVisible(false); actionSheet.current?.setModalVisible(false);
sleep(200).then(() => { sleep(200).then(() => {
this.setState({ this.setState({
visible: false, visible: false,