From 498e46ae4e698e5a75dec9972209fe2bb8a2a603 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 13 Jun 2024 11:03:31 +0200 Subject: [PATCH 1/2] Hide bio and social proof for blocked users (#4504) --- src/screens/Profile/Header/ProfileHeaderStandard.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/screens/Profile/Header/ProfileHeaderStandard.tsx b/src/screens/Profile/Header/ProfileHeaderStandard.tsx index f8a87a68e4..4ad84ac633 100644 --- a/src/screens/Profile/Header/ProfileHeaderStandard.tsx +++ b/src/screens/Profile/Header/ProfileHeaderStandard.tsx @@ -75,6 +75,10 @@ let ProfileHeaderStandard = ({ const [_queueBlock, queueUnblock] = useProfileBlockMutationQueue(profile) const unblockPromptControl = Prompt.usePromptControl() const requireAuth = useRequireAuth() + const isBlockedUser = + profile.viewer?.blocking || + profile.viewer?.blockedBy || + profile.viewer?.blockingByList const onPressEditProfile = React.useCallback(() => { track('ProfileHeader:EditProfileButtonClicked') @@ -257,7 +261,7 @@ let ProfileHeaderStandard = ({ - {!isPlaceholderProfile && ( + {!isPlaceholderProfile && !isBlockedUser && ( <> {descriptionRT && !moderation.ui('profileView').blur ? ( @@ -274,6 +278,7 @@ let ProfileHeaderStandard = ({ ) : undefined} {!isMe && + !isBlockedUser && shouldShowKnownFollowers(profile.viewer?.knownFollowers) && ( Date: Thu, 13 Jun 2024 15:58:56 +0100 Subject: [PATCH 2/2] Calculate correct keyboard offset in composer (#4500) * calculate correct keyboard offset * give viewHeight a default value * much simpler approach --- src/view/com/composer/Composer.tsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 9bb704012e..80bce5351c 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -415,12 +415,14 @@ export const ComposePost = observer(function ComposePost({ bottomBarAnimatedStyle, } = useAnimatedBorders() + const keyboardVerticalOffset = useKeyboardVerticalOffset() + return ( + keyboardVerticalOffset={keyboardVerticalOffset} + style={a.flex_1}> @@ -741,6 +743,19 @@ function useAnimatedBorders() { } } +function useKeyboardVerticalOffset() { + const {top} = useSafeAreaInsets() + + // Android etc + if (!isIOS) return 0 + + // iPhone SE + if (top === 20) return 40 + + // all other iPhones + return top + 10 +} + const styles = StyleSheet.create({ topbarInner: { flexDirection: 'row',