diff options
author | Leon Jiang <35908040+leonyjiang@users.noreply.github.com> | 2021-04-01 23:58:02 -0400 |
---|---|---|
committer | Leon Jiang <35908040+leonyjiang@users.noreply.github.com> | 2021-04-01 23:58:02 -0400 |
commit | b6a31427f784c2e88ad6fe0178e5fd873b4a1099 (patch) | |
tree | 43ebd834bc4573c67914963af97d10d73f08f710 /src/components/profile/Content.tsx | |
parent | f570f6c75ff051e9f8afe359a237a05828dc6ffb (diff) |
Improve position of overlaid tutorial
Diffstat (limited to 'src/components/profile/Content.tsx')
-rw-r--r-- | src/components/profile/Content.tsx | 8 |
1 files changed, 8 insertions, 0 deletions
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<ContentProps> = ({y, userXId, screenType}) => { */ const [isBlocked, setIsBlocked] = useState<boolean>(false); const [profileBodyHeight, setProfileBodyHeight] = useState(0); + const [socialsBarHeight, setSocialsBarHeight] = useState(0); const [shouldBounce, setShouldBounce] = useState<boolean>(true); const [refreshing, setRefreshing] = useState<boolean>(false); @@ -88,6 +89,11 @@ const Content: React.FC<ContentProps> = ({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<ContentProps> = ({y, userXId, screenType}) => { <TaggsBar {...{y, profileBodyHeight, userXId, screenType}} whiteRing={undefined} + onLayout={onSocialsBarLayout} /> {canViewProfile(state, userXId, screenType) ? ( <PublicProfile @@ -175,6 +182,7 @@ const Content: React.FC<ContentProps> = ({y, userXId, screenType}) => { screenType, setScrollEnabled, profileBodyHeight, + socialsBarHeight, scrollViewRef, }} /> |