1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
This commit is contained in:
Zhiyuan Zheng
2021-01-17 22:37:05 +01:00
parent 813f6b57c4
commit f977fdfa8b
44 changed files with 252 additions and 158 deletions

View File

@ -123,19 +123,28 @@ const Compose: React.FC<SharedComposeProp> = ({
<HeaderLeft
type='text'
content='退出编辑'
onPress={() =>
Alert.alert('确认取消编辑?', '', [
{
text: '退出编辑',
style: 'destructive',
onPress: () => navigation.goBack()
},
{ text: '继续编辑', style: 'cancel' }
])
}
onPress={() => {
if (
totalTextCount === 0 &&
composeState.attachments.uploads.length === 0 &&
composeState.poll.active === false
) {
navigation.goBack()
return
} else {
Alert.alert('确认取消编辑?', '', [
{
text: '退出编辑',
style: 'destructive',
onPress: () => navigation.goBack()
},
{ text: '继续编辑', style: 'cancel' }
])
}
}}
/>
),
[]
[totalTextCount]
)
const headerCenter = useCallback(
() => (