aboutsummaryrefslogtreecommitdiff
path: root/src/screens/profile/CaptionScreen.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-05-05 18:36:39 -0400
committerGitHub <noreply@github.com>2021-05-05 18:36:39 -0400
commitc9d32e68fbb9d1bc175722bfda49454a6f627eae (patch)
tree5f7b3cf0937ca073f03dde2f84ce5c0e50a038a3 /src/screens/profile/CaptionScreen.tsx
parentd4a04e31144f6cfaebb0b892e3593bb02bd49ed5 (diff)
parent32a61c00756afb1aee0eb471ed643f24da1d3e85 (diff)
Merge pull request #401 from IvanIFChen/tma296-add-mentions
[TMA-296] Add mentions
Diffstat (limited to 'src/screens/profile/CaptionScreen.tsx')
-rw-r--r--src/screens/profile/CaptionScreen.tsx17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx
index 156ee41c..041f0da2 100644
--- a/src/screens/profile/CaptionScreen.tsx
+++ b/src/screens/profile/CaptionScreen.tsx
@@ -11,9 +11,10 @@ import {
TouchableWithoutFeedback,
View,
} from 'react-native';
+import {MentionInput} from 'react-native-controlled-mentions';
import {Button} from 'react-native-elements';
import {useDispatch, useSelector} from 'react-redux';
-import {SearchBackground, TaggBigInput} from '../../components';
+import {SearchBackground} from '../../components';
import {CaptionScreenHeader} from '../../components/';
import TaggLoadingIndicator from '../../components/common/TaggLoadingIndicator';
import {TAGG_LIGHT_BLUE_2} from '../../constants';
@@ -26,6 +27,7 @@ import {
} from '../../store/actions';
import {RootState} from '../../store/rootReducer';
import {SCREEN_WIDTH, StatusBarHeight} from '../../utils';
+import {mentionPartTypes} from '../../utils/comments';
/**
* Upload Screen to allow users to upload posts to Tagg
@@ -49,10 +51,6 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => {
const [caption, setCaption] = useState('');
const [loading, setLoading] = useState(false);
- const handleCaptionUpdate = (newCaption: string) => {
- setCaption(newCaption);
- };
-
const navigateToProfile = () => {
//Since the logged In User is navigating to own profile, useXId is not required
navigation.navigate('Profile', {
@@ -112,12 +110,13 @@ const CaptionScreen: React.FC<CaptionScreenProps> = ({route, navigation}) => {
source={{uri: image.path}}
resizeMode={'cover'}
/>
- <TaggBigInput
- style={styles.text}
- multiline
+ <MentionInput
+ containerStyle={styles.text}
placeholder="Write something....."
placeholderTextColor="gray"
- onChangeText={handleCaptionUpdate}
+ value={caption}
+ onChange={setCaption}
+ partTypes={mentionPartTypes}
/>
</View>
</KeyboardAvoidingView>