aboutsummaryrefslogtreecommitdiff
path: root/src/components/profile/Content.tsx
diff options
context:
space:
mode:
authorIvan Chen <ivan@tagg.id>2021-04-06 12:14:29 -0400
committerGitHub <noreply@github.com>2021-04-06 12:14:29 -0400
commita3abb3abe322ea84306e1a12cec46972a81a37de (patch)
tree697ec80502d6c4d8249cbbea2cad62262e335587 /src/components/profile/Content.tsx
parentaac68b10d5f05f4a8bd137cfd2a85ef6f6e4dbdf (diff)
parentb6a31427f784c2e88ad6fe0178e5fd873b4a1099 (diff)
Merge pull request #352 from leonyjiang/tma739-patch-iphone-12
[TMA-739] Bugfix Patch — Moment Posting Tutorial Position
Diffstat (limited to 'src/components/profile/Content.tsx')
-rw-r--r--src/components/profile/Content.tsx8
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,
}}
/>