aboutsummaryrefslogtreecommitdiff
path: root/src/components/common
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/common
parent643e7adcda3e5ae7aa3daeb86020f2e6f38d1448 (diff)
parentfa9c527f85d23a38b45c7efc41ec4590597fa7a1 (diff)
Merge master into this test branch.
Diffstat (limited to 'src/components/common')
-rw-r--r--src/components/common/MomentTags.tsx14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/components/common/MomentTags.tsx b/src/components/common/MomentTags.tsx
index 4afacddb..d8a70353 100644
--- a/src/components/common/MomentTags.tsx
+++ b/src/components/common/MomentTags.tsx
@@ -1,4 +1,5 @@
-import React, {createRef, MutableRefObject, useEffect, useState} from 'react';
+import React, {createRef, RefObject, useEffect, useState} from 'react';
+import {Image, View} from 'react-native';
import {MomentTagType, ProfilePreviewType} from '../../types';
import TaggDraggable from '../taggs/TaggDraggable';
import Draggable from './Draggable';
@@ -7,7 +8,7 @@ interface MomentTagsProps {
editing: boolean;
tags: MomentTagType[];
setTags: (tag: MomentTagType[]) => void;
- imageRef: MutableRefObject<null>;
+ imageRef: RefObject<Image>;
deleteFromList?: (user: ProfilePreviewType) => void;
}
@@ -21,14 +22,9 @@ const MomentTags: React.FC<MomentTagsProps> = ({
const [offset, setOffset] = useState([0, 0]);
const [imageDimensions, setImageDimensions] = useState([0, 0]);
const [maxZIndex, setMaxZIndex] = useState(1);
- const [draggableRefs, setDraggableRefs] = useState<
- React.MutableRefObject<null>[]
- >([]);
+ const [draggableRefs, setDraggableRefs] = useState<RefObject<View>[]>([]);
- const updateTagPosition = (
- ref: React.MutableRefObject<null>,
- userId: string,
- ) => {
+ const updateTagPosition = (ref: RefObject<Image>, userId: string) => {
if (ref !== null && ref.current !== null) {
ref.current.measure(
(