* edit screen - in progress * edit screen - in progress * edit post screen - post input - in progress * edit post screen - post input - in progress * edit post screen - post input - in progress * edit post screen - post input - in progress * edit post screen - post error component - in progress * edit post screen - post error component - in progress * edit post screen -emitEditing - in progress * edit post screen - in progress * edit post screen - in progress * edit post screen - in progress * able to edit post * edit post screen - in progress * edit post screen - in progress * edit post screen - in progress * edit post screen - in progress * updated errorLine * corrections * edit post screen - in progress * edit post screen - in progress * edit post screen - in progress * properly closes modal on tablets * starts with Save button set to false * refactored onTextSelectionChange * added useTheme to ErrorTextComponent * passing canEdit and hasFilesAttached * passing canEdit and hasFilesAttached * fix API call * change canEdit to canDelete * nearly there * displays alert * maxPostSize * autocomplete - fixing layout * autocomplete - fixing layout * autocomplete - work in progress * autocomplete - work in progress * clean up delete * fixing autocomplete * code fix * added server error message * update i18n * removed comment * code fix * fix bug on empty post message * post input top corrections * post draft limit * code corrections as per review * removed theme from useEffect * update edit_post - delete call * refactor PostInputRef to EditPostInputRef * autocomplete position fix and feedback addressed * Navigation title & subtitle fonts / navigation button builder * ux feedback * delay focus of edit input by 20 frames * properly dismiss the PostOptions screen this comes from the fix for the BottomSheet screen * using device info to check for physical keyboard * autocomplete with keyboard closed Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
57 lines
1.4 KiB
TypeScript
57 lines
1.4 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import React from 'react';
|
|
import {StyleSheet, View} from 'react-native';
|
|
|
|
import ErrorText from '@components/error_text';
|
|
|
|
type PostErrorProps = {
|
|
errorLine?: string;
|
|
errorExtra?: string;
|
|
}
|
|
|
|
const styles = StyleSheet.create({
|
|
errorContainerSplit: {
|
|
paddingHorizontal: 15,
|
|
flexDirection: 'row',
|
|
justifyContent: 'space-between',
|
|
width: '100%',
|
|
},
|
|
errorContainer: {
|
|
paddingHorizontal: 10,
|
|
width: '100%',
|
|
},
|
|
errorWrap: {
|
|
flexShrink: 1,
|
|
paddingRight: 20,
|
|
},
|
|
errorWrapper: {
|
|
alignItems: 'center',
|
|
},
|
|
});
|
|
|
|
const PostError = ({errorLine, errorExtra}: PostErrorProps) => {
|
|
return (
|
|
<View
|
|
style={errorExtra ? styles.errorContainerSplit : styles.errorContainer}
|
|
>
|
|
{Boolean(errorLine) && (
|
|
<ErrorText
|
|
testID='edit_post.error.text'
|
|
error={errorLine!}
|
|
textStyle={styles.errorWrap}
|
|
/>
|
|
)}
|
|
{Boolean(errorExtra) && (
|
|
<ErrorText
|
|
testID='edit_post.error.text.extra'
|
|
error={errorExtra!}
|
|
textStyle={!errorLine && styles.errorWrapper}
|
|
/>
|
|
)}
|
|
</View>
|
|
);
|
|
};
|
|
|
|
export default PostError;
|