Add drafts warning

Fixed #259
This commit is contained in:
Zhiyuan Zheng 2022-05-29 17:45:53 +02:00
parent c94ef1882b
commit af0756cef2
2 changed files with 25 additions and 1 deletions

View File

@ -168,6 +168,7 @@
"header": {
"title": "Draft"
},
"warning": "Drafts are only stored locally, and can be lost in unfortunate events. Advise not using drafts for long term storage.",
"content": {
"accessibilityHint": "Saved draft, tap to edit this draft",
"textEmpty": "Content empty"

View File

@ -53,7 +53,6 @@ const ComposeDraftsListRoot: React.FC<Props> = ({ timestamp }) => {
const renderItem = useCallback(
({ item }: { item: ComposeStateDraft }) => {
console.log('timestamp', item.timestamp)
return (
<Pressable
accessibilityHint={t('content.draftsList.content.accessibilityHint')}
@ -193,6 +192,30 @@ const ComposeDraftsListRoot: React.FC<Props> = ({ timestamp }) => {
return (
<>
<View
style={{
flexDirection: 'row',
alignItems: 'center',
marginHorizontal: StyleConstants.Spacing.Global.PagePadding,
padding: StyleConstants.Spacing.S,
borderColor: colors.border,
borderWidth: 1,
borderRadius: StyleConstants.Spacing.S
}}
>
<Icon
name='AlertTriangle'
color={colors.secondary}
size={StyleConstants.Font.Size.M}
style={{ marginRight: StyleConstants.Spacing.S }}
/>
<CustomText
fontStyle='S'
style={{ flexShrink: 1, color: colors.secondary }}
>
{t('content.draftsList.warning')}
</CustomText>
</View>
<PanGestureHandler enabled={Platform.OS === 'ios'}>
<SwipeListView
data={instanceDrafts}