From 6e09b4245f3a96560ca0eb74d46e8fd40a164f44 Mon Sep 17 00:00:00 2001 From: Brian Kim Date: Wed, 19 May 2021 17:26:40 -0700 Subject: Fix redirect --- src/components/profile/TaggAvatar.tsx | 2 ++ src/components/taggs/TaggDraggable.tsx | 14 +++++++++----- src/screens/profile/CaptionScreen.tsx | 11 +++++++++-- src/screens/profile/DraggableNoPress.tsx | 0 4 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 src/screens/profile/DraggableNoPress.tsx (limited to 'src') diff --git a/src/components/profile/TaggAvatar.tsx b/src/components/profile/TaggAvatar.tsx index 8ccae2ef..8cd52a2f 100644 --- a/src/components/profile/TaggAvatar.tsx +++ b/src/components/profile/TaggAvatar.tsx @@ -23,6 +23,8 @@ const TaggAvatar: React.FC = ({ userXId, editable = false, }) => { + const state = useSelector((state: RootState) => state); + console.log('STATE', state.userX); const {avatar, user} = useSelector((state: RootState) => userXId ? state.userX[screenType][userXId] : state.user, ); diff --git a/src/components/taggs/TaggDraggable.tsx b/src/components/taggs/TaggDraggable.tsx index ac494a6b..06185bd1 100644 --- a/src/components/taggs/TaggDraggable.tsx +++ b/src/components/taggs/TaggDraggable.tsx @@ -79,19 +79,23 @@ const TaggDraggable: React.FC = ( onLayout={(event) => console.log(event.nativeEvent.layout)}> gotoTaggedProfile(taggedUser.userId)} - disabled={false} + disabled={redirect} style={[styles.button]} ref={draggableRef}> @{taggedUser.username} - deleteFromList()}> - - + {redirect && ( + deleteFromList()}> + + + )} diff --git a/src/screens/profile/CaptionScreen.tsx b/src/screens/profile/CaptionScreen.tsx index 37003207..f72b1165 100644 --- a/src/screens/profile/CaptionScreen.tsx +++ b/src/screens/profile/CaptionScreen.tsx @@ -36,6 +36,7 @@ import {mentionPartTypes} from '../../utils/comments'; import TaggDraggable from '../../components/taggs/TaggDraggable'; import Draggable from '../../components/common/Draggable'; +import {UserType} from 'src/types'; /** * Upload Screen to allow users to upload posts to Tagg @@ -75,6 +76,12 @@ const CaptionScreen: React.FC = ({route, navigation}) => { const [curStart, setCurStart] = useState([0, 0]); const [dim, setDim] = useState([0, 0]); + const testUser: UserType = { + // userId: '1216bbb4-f778-4ef3-b7f8-a55bde1ab1a1', + userId: 'ID-1234-567', + username: 'dragonofthewest', + }; + const navigateToProfile = () => { //Since the logged In User is navigating to own profile, useXId is not required navigation.navigate('Profile', { @@ -175,8 +182,8 @@ const CaptionScreen: React.FC = ({route, navigation}) => { minY={0} maxX={50} maxY={50} - taggedUser={user} - redirect={true} + taggedUser={testUser} + redirect={false} deleteFromList={() => console.log('Hello world')} setStart={setCurStart} /> diff --git a/src/screens/profile/DraggableNoPress.tsx b/src/screens/profile/DraggableNoPress.tsx new file mode 100644 index 00000000..e69de29b -- cgit v1.2.3-70-g09d2