about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKuwa Lee <kuwalee1069@gmail.com>2024-06-14 01:33:19 +0800
committerGitHub <noreply@github.com>2024-06-14 01:33:19 +0800
commit92fe3cde7a226ec81308676afed6978d9f85eb53 (patch)
tree48e41f23fad6857792b32a4a87a199487e5988b8
parentecd51bc6f9f7d755eb023c3d336c21ea5b1583e5 (diff)
parentd20c59e19d457ee2c57496f00dc962ea0c19a691 (diff)
downloadvoidsky-92fe3cde7a226ec81308676afed6978d9f85eb53.tar.zst
Merge branch 'bluesky-social:main' into zh
-rw-r--r--src/screens/Profile/Header/ProfileHeaderStandard.tsx7
-rw-r--r--src/view/com/composer/Composer.tsx19
2 files changed, 23 insertions, 3 deletions
diff --git a/src/screens/Profile/Header/ProfileHeaderStandard.tsx b/src/screens/Profile/Header/ProfileHeaderStandard.tsx
index f8a87a68e..4ad84ac63 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 = ({
           <ProfileHeaderDisplayName profile={profile} moderation={moderation} />
           <ProfileHeaderHandle profile={profile} />
         </View>
-        {!isPlaceholderProfile && (
+        {!isPlaceholderProfile && !isBlockedUser && (
           <>
             <ProfileHeaderMetrics profile={profile} />
             {descriptionRT && !moderation.ui('profileView').blur ? (
@@ -274,6 +278,7 @@ let ProfileHeaderStandard = ({
             ) : undefined}
 
             {!isMe &&
+              !isBlockedUser &&
               shouldShowKnownFollowers(profile.viewer?.knownFollowers) && (
                 <View style={[a.flex_row, a.align_center, a.gap_sm, a.pt_md]}>
                   <KnownFollowers
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx
index 9bb704012..80bce5351 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 (
     <KeyboardAvoidingView
       testID="composePostView"
       behavior={isIOS ? 'padding' : 'height'}
-      keyboardVerticalOffset={isIOS ? 70 : 0}
-      style={[a.flex_1]}>
+      keyboardVerticalOffset={keyboardVerticalOffset}
+      style={a.flex_1}>
       <View style={[a.flex_1, viewStyles]} aria-modal accessibilityViewIsModal>
         <Animated.View style={topBarAnimatedStyle}>
           <View style={styles.topbarInner}>
@@ -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',