diff options
| author | Ivan Chen <ivan@tagg.id> | 2021-05-27 11:00:46 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-27 11:00:46 -0400 |
| commit | 0e31510f9f1669c766195d1d245fcee6a745bf93 (patch) | |
| tree | 83eb093863c73f47de1936c91066279ec23e31d2 /src/components/taggs/TaggDraggable.tsx | |
| parent | 928b94f77581216e1e6d2d180986a4260f040c93 (diff) | |
| parent | b87ad0f18d491a27bbb458887abdd2ab09e64d1e (diff) | |
Merge pull request #449 from grusuTagg/tma883-Layered-Taggs
[TMA-883] Layered Tags
Diffstat (limited to 'src/components/taggs/TaggDraggable.tsx')
| -rw-r--r-- | src/components/taggs/TaggDraggable.tsx | 17 |
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, |
