From b6a31427f784c2e88ad6fe0178e5fd873b4a1099 Mon Sep 17 00:00:00 2001 From: Leon Jiang <35908040+leonyjiang@users.noreply.github.com> Date: Thu, 1 Apr 2021 23:58:02 -0400 Subject: Improve position of overlaid tutorial --- src/components/profile/Content.tsx | 8 ++++++++ src/components/profile/PublicProfile.tsx | 3 +++ 2 files changed, 11 insertions(+) (limited to 'src/components/profile') diff --git a/src/components/profile/Content.tsx b/src/components/profile/Content.tsx index 9c33eabc..fef92dc1 100644 --- a/src/components/profile/Content.tsx +++ b/src/components/profile/Content.tsx @@ -66,6 +66,7 @@ const Content: React.FC = ({y, userXId, screenType}) => { */ const [isBlocked, setIsBlocked] = useState(false); const [profileBodyHeight, setProfileBodyHeight] = useState(0); + const [socialsBarHeight, setSocialsBarHeight] = useState(0); const [shouldBounce, setShouldBounce] = useState(true); const [refreshing, setRefreshing] = useState(false); @@ -88,6 +89,11 @@ const Content: React.FC = ({y, userXId, screenType}) => { setProfileBodyHeight(height); }; + const onSocialsBarLayout = (e: LayoutChangeEvent) => { + const {height} = e.nativeEvent.layout; + setSocialsBarHeight(height); + }; + useEffect(() => { const isActuallyBlocked = blockedUsers.some( (cur_user) => user.username === cur_user.username, @@ -166,6 +172,7 @@ const Content: React.FC = ({y, userXId, screenType}) => { {canViewProfile(state, userXId, screenType) ? ( = ({y, userXId, screenType}) => { screenType, setScrollEnabled, profileBodyHeight, + socialsBarHeight, scrollViewRef, }} /> diff --git a/src/components/profile/PublicProfile.tsx b/src/components/profile/PublicProfile.tsx index 88e0ecd1..eceb2fc3 100644 --- a/src/components/profile/PublicProfile.tsx +++ b/src/components/profile/PublicProfile.tsx @@ -35,6 +35,7 @@ const PublicProfile: React.FC = ({ screenType, setScrollEnabled, profileBodyHeight, + socialsBarHeight, scrollViewRef, }) => { const dispatch = useDispatch(); @@ -104,6 +105,7 @@ const PublicProfile: React.FC = ({ screenType, momentCategory: momentCategories[0], profileBodyHeight, + socialsBarHeight, }); setIsStageOnePromptClosed(true); } @@ -133,6 +135,7 @@ const PublicProfile: React.FC = ({ navigation, screenType, profileBodyHeight, + socialsBarHeight, scrollViewRef, ]), ); -- cgit v1.2.3-70-g09d2