aboutsummaryrefslogtreecommitdiff
path: root/src/components/comments/CommentTextField.tsx
diff options
context:
space:
mode:
authorMichael <michael.foiani@gmail.com>2021-07-02 14:45:18 -0400
committerMichael <michael.foiani@gmail.com>2021-07-02 14:45:18 -0400
commit0d95e094b6370f32f6214d74a87ca56ea6eb477e (patch)
tree9cb100002b07a2ccd2aecbdf727d1ddb33ca0df7 /src/components/comments/CommentTextField.tsx
parent643e7adcda3e5ae7aa3daeb86020f2e6f38d1448 (diff)
parentfa9c527f85d23a38b45c7efc41ec4590597fa7a1 (diff)
Merge master into this test branch.
Diffstat (limited to 'src/components/comments/CommentTextField.tsx')
-rw-r--r--src/components/comments/CommentTextField.tsx45
1 files changed, 19 insertions, 26 deletions
diff --git a/src/components/comments/CommentTextField.tsx b/src/components/comments/CommentTextField.tsx
index 6e92329c..6d86eb3f 100644
--- a/src/components/comments/CommentTextField.tsx
+++ b/src/components/comments/CommentTextField.tsx
@@ -1,8 +1,8 @@
import React, {FC, ReactFragment} from 'react';
import {
NativeSyntheticEvent,
- StyleSheet,
StyleProp,
+ StyleSheet,
Text,
TextInput,
TextInputSelectionChangeEventData,
@@ -10,22 +10,21 @@ import {
View,
ViewStyle,
} from 'react-native';
-import {useSelector} from 'react-redux';
-import {TAGG_LIGHT_BLUE} from '../../constants';
-import {RootState} from '../../store/rootReducer';
import {
+ MentionPartType,
Part,
PartType,
- MentionPartType,
} from 'react-native-controlled-mentions/dist/types';
import {
defaultMentionTextStyle,
isMentionPartType,
} from 'react-native-controlled-mentions/dist/utils';
-import {Avatar} from '../common';
-import {normalize} from '../../utils';
-
+import {useSelector} from 'react-redux';
import UpArrowIcon from '../../assets/icons/up_arrow.svg';
+import {TAGG_LIGHT_BLUE} from '../../constants';
+import {RootState} from '../../store/rootReducer';
+import {normalize} from '../../utils';
+import {Avatar} from '../common';
type CommentTextFieldProps = {
containerStyle: StyleProp<ViewStyle>;
@@ -40,8 +39,6 @@ type CommentTextFieldProps = {
) => null;
parts: Part[];
addComment: () => any;
- theme?: 'dark' | 'white';
- keyboardVisible?: boolean;
comment?: string;
};
@@ -56,8 +53,6 @@ const CommentTextField: FC<CommentTextFieldProps> = ({
handleSelectionChange,
parts,
addComment,
- theme = 'white',
- keyboardVisible = true,
comment = '',
...textInputProps
}) => {
@@ -99,20 +94,18 @@ const CommentTextField: FC<CommentTextFieldProps> = ({
)}
</Text>
</TextInput>
- {(theme === 'white' || (theme === 'dark' && keyboardVisible)) && (
- <View style={styles.submitButton}>
- <TouchableOpacity
- style={
- comment === ''
- ? [styles.submitButton, styles.greyButton]
- : styles.submitButton
- }
- disabled={comment === ''}
- onPress={addComment}>
- <UpArrowIcon width={35} height={35} color={'white'} />
- </TouchableOpacity>
- </View>
- )}
+ <View style={styles.submitButton}>
+ <TouchableOpacity
+ style={
+ comment === ''
+ ? [styles.submitButton, styles.greyButton]
+ : styles.submitButton
+ }
+ disabled={comment === ''}
+ onPress={addComment}>
+ <UpArrowIcon width={35} height={35} color={'white'} />
+ </TouchableOpacity>
+ </View>
</View>
{validateInput(keyboardText) &&