mirror of https://github.com/tooot-app/app
Fixed #37
This commit is contained in:
parent
b21194ca5a
commit
83d472bc4a
|
@ -343,8 +343,7 @@ const ScreenCompose: React.FC<ScreenComposeProp> = ({
|
||||||
return (
|
return (
|
||||||
<KeyboardAvoidingView
|
<KeyboardAvoidingView
|
||||||
style={styles.base}
|
style={styles.base}
|
||||||
behavior={Platform.OS === 'ios' ? 'padding' : 'height'}
|
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
||||||
keyboardVerticalOffset={Platform.OS === 'android' ? 30 : 0}
|
|
||||||
>
|
>
|
||||||
<SafeAreaView
|
<SafeAreaView
|
||||||
style={styles.base}
|
style={styles.base}
|
||||||
|
|
|
@ -9,11 +9,12 @@ import {
|
||||||
} from '@utils/slices/instancesSlice'
|
} from '@utils/slices/instancesSlice'
|
||||||
import { StyleConstants } from '@utils/styles/constants'
|
import { StyleConstants } from '@utils/styles/constants'
|
||||||
import { useTheme } from '@utils/styles/ThemeManager'
|
import { useTheme } from '@utils/styles/ThemeManager'
|
||||||
import React, { useCallback, useContext, useState } from 'react'
|
import React, { useCallback, useContext, useEffect, useState } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import {
|
import {
|
||||||
Dimensions,
|
Dimensions,
|
||||||
Modal,
|
Modal,
|
||||||
|
Platform,
|
||||||
Pressable,
|
Pressable,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
Text,
|
Text,
|
||||||
|
@ -41,6 +42,12 @@ const ComposeDraftsListRoot: React.FC<Props> = ({ timestamp }) => {
|
||||||
draft => draft.timestamp !== timestamp
|
draft => draft.timestamp !== timestamp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (instanceDrafts?.length === 0) {
|
||||||
|
navigation.goBack()
|
||||||
|
}
|
||||||
|
}, [instanceDrafts?.length])
|
||||||
|
|
||||||
const actionWidth =
|
const actionWidth =
|
||||||
StyleConstants.Font.Size.L + StyleConstants.Spacing.Global.PagePadding * 4
|
StyleConstants.Font.Size.L + StyleConstants.Spacing.Global.PagePadding * 4
|
||||||
|
|
||||||
|
@ -156,18 +163,18 @@ const ComposeDraftsListRoot: React.FC<Props> = ({ timestamp }) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<PanGestureHandler enabled={true}>
|
<PanGestureHandler enabled={Platform.OS === 'ios'}>
|
||||||
<SwipeListView
|
<SwipeListView
|
||||||
data={instanceDrafts}
|
data={instanceDrafts}
|
||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
renderHiddenItem={renderHiddenItem}
|
renderHiddenItem={renderHiddenItem}
|
||||||
disableRightSwipe={true}
|
disableRightSwipe={true}
|
||||||
rightOpenValue={-actionWidth}
|
rightOpenValue={-actionWidth}
|
||||||
previewRowKey={
|
// previewRowKey={
|
||||||
instanceDrafts?.length
|
// instanceDrafts?.length
|
||||||
? instanceDrafts[0].timestamp.toString()
|
// ? instanceDrafts[0].timestamp.toString()
|
||||||
: undefined
|
// : undefined
|
||||||
}
|
// }
|
||||||
// previewDuration={350}
|
// previewDuration={350}
|
||||||
previewOpenValue={-actionWidth / 2}
|
previewOpenValue={-actionWidth / 2}
|
||||||
ItemSeparatorComponent={ComponentSeparator}
|
ItemSeparatorComponent={ComponentSeparator}
|
||||||
|
|
Loading…
Reference in New Issue