aboutsummaryrefslogtreecommitdiff
path: root/src/components/taggs
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/taggs')
-rw-r--r--src/components/taggs/TaggDraggable.tsx17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/components/taggs/TaggDraggable.tsx b/src/components/taggs/TaggDraggable.tsx
index 12e8e1e1..d458fab6 100644
--- a/src/components/taggs/TaggDraggable.tsx
+++ b/src/components/taggs/TaggDraggable.tsx
@@ -1,5 +1,5 @@
import {useNavigation} from '@react-navigation/native';
-import React, {useEffect, useRef} from 'react';
+import React from 'react';
import {
Image,
StyleSheet,
@@ -7,6 +7,7 @@ import {
TouchableOpacity,
TouchableWithoutFeedback,
View,
+ ViewProps,
} from 'react-native';
import {useDispatch, useSelector} from 'react-redux';
import Avatar from '../../components/common/Avatar';
@@ -15,31 +16,23 @@ import {ProfilePreviewType, ScreenType, UserType} from '../../types';
import {normalize} from '../../utils';
import {navigateToProfile} from '../../utils/users';
-interface TaggDraggableProps {
+interface TaggDraggableProps extends ViewProps {
+ draggableRef: React.MutableRefObject<null>;
taggedUser: ProfilePreviewType;
editingView: boolean;
deleteFromList: () => void;
- setStart: Function;
}
const TaggDraggable: React.FC<TaggDraggableProps> = (
props: TaggDraggableProps,
) => {
+ const {draggableRef, taggedUser, editingView, deleteFromList} = props;
const navigation = useNavigation();
const dispatch = useDispatch();
const state = useSelector((rs: RootState) => rs);
- const {taggedUser, editingView, deleteFromList, setStart} = props;
let uriX = require('../../assets/images/draggableX.png');
let uriTip = require('../../assets/images/Tagg-Triangle.png');
- const draggableRef = useRef(null);
-
- useEffect(() => {
- draggableRef.current.measure((width: number, height: number) => {
- setStart([width, height]);
- });
- }, []);
-
const user: UserType = {
userId: taggedUser.id,
username: taggedUser.username,