mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-23 21:35:04 +03:00
Merge pull request #2112 from ecency/nt/editor-replace
NT - Editor Replace
This commit is contained in:
commit
a4682a4044
@ -28,6 +28,8 @@ const DraftsContainer = ({ currentAccount, intl, navigation, dispatch }) => {
|
|||||||
const [schedules, setSchedules] = useState([]);
|
const [schedules, setSchedules] = useState([]);
|
||||||
const [isLoading, setIsLoading] = useState(false);
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
|
const [initialTabIndex] = useState(navigation.state?.params?.showSchedules ? 1 : 0);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
_getDrafts();
|
_getDrafts();
|
||||||
_getSchedules();
|
_getSchedules();
|
||||||
@ -145,6 +147,7 @@ const DraftsContainer = ({ currentAccount, intl, navigation, dispatch }) => {
|
|||||||
removeDraft={_removeDraft}
|
removeDraft={_removeDraft}
|
||||||
moveScheduleToDraft={_moveScheduleToDraft}
|
moveScheduleToDraft={_moveScheduleToDraft}
|
||||||
removeSchedule={_removeSchedule}
|
removeSchedule={_removeSchedule}
|
||||||
|
initialTabIndex={initialTabIndex}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,6 @@ import { BasicHeader, TabBar, DraftListItem, PostCardPlaceHolder } from '../../.
|
|||||||
import globalStyles from '../../../globalStyles';
|
import globalStyles from '../../../globalStyles';
|
||||||
import styles from './draftStyles';
|
import styles from './draftStyles';
|
||||||
import { OptionsModal } from '../../../components/atoms';
|
import { OptionsModal } from '../../../components/atoms';
|
||||||
import { jsonStringify } from '../../../utils/jsonUtils';
|
|
||||||
|
|
||||||
const DraftsScreen = ({
|
const DraftsScreen = ({
|
||||||
currentAccount,
|
currentAccount,
|
||||||
@ -27,6 +26,7 @@ const DraftsScreen = ({
|
|||||||
drafts,
|
drafts,
|
||||||
schedules,
|
schedules,
|
||||||
moveScheduleToDraft,
|
moveScheduleToDraft,
|
||||||
|
initialTabIndex,
|
||||||
}) => {
|
}) => {
|
||||||
const [selectedId, setSelectedId] = useState(null);
|
const [selectedId, setSelectedId] = useState(null);
|
||||||
const ActionSheetRef = useRef(null);
|
const ActionSheetRef = useRef(null);
|
||||||
@ -123,6 +123,7 @@ const DraftsScreen = ({
|
|||||||
|
|
||||||
<ScrollableTabView
|
<ScrollableTabView
|
||||||
style={[globalStyles.tabView, { paddingBottom: 40 }]}
|
style={[globalStyles.tabView, { paddingBottom: 40 }]}
|
||||||
|
initialPage={initialTabIndex}
|
||||||
renderTabBar={() => (
|
renderTabBar={() => (
|
||||||
<TabBar
|
<TabBar
|
||||||
style={styles.tabbar}
|
style={styles.tabbar}
|
||||||
|
@ -717,13 +717,14 @@ class EditorContainer extends Component {
|
|||||||
this.setState({
|
this.setState({
|
||||||
isPostSending: false,
|
isPostSending: false,
|
||||||
});
|
});
|
||||||
navigation.navigate({
|
navigation.replace(
|
||||||
routeName: ROUTES.SCREENS.PROFILE,
|
ROUTES.SCREENS.PROFILE,
|
||||||
params: {
|
{
|
||||||
username: get(currentAccount, 'name'),
|
username: get(currentAccount, 'name'),
|
||||||
},
|
},{
|
||||||
key: get(currentAccount, 'name'),
|
key:get(currentAccount, 'name')
|
||||||
});
|
}
|
||||||
|
);
|
||||||
}, 3000);
|
}, 3000);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@ -1058,10 +1059,10 @@ class EditorContainer extends Component {
|
|||||||
);
|
);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
navigation.navigate({
|
navigation.replace(ROUTES.SCREENS.DRAFTS,
|
||||||
routeName: ROUTES.SCREENS.DRAFTS,
|
{
|
||||||
key: currentAccount.name,
|
showSchedules:true
|
||||||
});
|
})
|
||||||
}, 3000);
|
}, 3000);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user