From 4e50ba72255eb1b9fb7d1333becd9a8e8ac51d01 Mon Sep 17 00:00:00 2001 From: noumantahir Date: Sun, 3 Oct 2021 02:36:32 +0500 Subject: [PATCH] using optionsModel in draftsScreen --- src/screens/drafts/screen/draftsScreen.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/screens/drafts/screen/draftsScreen.js b/src/screens/drafts/screen/draftsScreen.js index a6a62ee5c..31651ddc2 100644 --- a/src/screens/drafts/screen/draftsScreen.js +++ b/src/screens/drafts/screen/draftsScreen.js @@ -1,8 +1,7 @@ -import React, { useState, useRef, useEffect } from 'react'; +import React, { useState, useRef } from 'react'; import { injectIntl } from 'react-intl'; import { View, FlatList, Text } from 'react-native'; import ScrollableTabView from 'react-native-scrollable-tab-view'; -import ActionSheet from 'react-native-actionsheet'; // Utils import { postBodySummary } from '@ecency/render-helper'; @@ -15,6 +14,7 @@ import { BasicHeader, TabBar, DraftListItem, PostCardPlaceHolder } from '../../. // Styles import globalStyles from '../../../globalStyles'; import styles from './draftStyles'; +import { OptionsModal } from '../../../components/atoms'; const DraftsScreen = ({ currentAccount, @@ -29,16 +29,10 @@ const DraftsScreen = ({ }) => { const [selectedId, setSelectedId] = useState(null); const ActionSheetRef = useRef(null); - const firstMount = useRef(true); - const selectedIdRef = useRef(); - - useEffect(() => { - selectedIdRef.current = selectedId; - }, [selectedId]); const _onActionPress = (index) => { if (index === 0) { - moveScheduleToDraft(selectedIdRef.current); + moveScheduleToDraft(selectedId); } }; @@ -148,7 +142,7 @@ const DraftsScreen = ({ {_getTabItem(schedules, 'schedules')} -