Merge branch 'bluesky-social:main' into zh
commit
92fe3cde7a
|
@ -75,6 +75,10 @@ let ProfileHeaderStandard = ({
|
||||||
const [_queueBlock, queueUnblock] = useProfileBlockMutationQueue(profile)
|
const [_queueBlock, queueUnblock] = useProfileBlockMutationQueue(profile)
|
||||||
const unblockPromptControl = Prompt.usePromptControl()
|
const unblockPromptControl = Prompt.usePromptControl()
|
||||||
const requireAuth = useRequireAuth()
|
const requireAuth = useRequireAuth()
|
||||||
|
const isBlockedUser =
|
||||||
|
profile.viewer?.blocking ||
|
||||||
|
profile.viewer?.blockedBy ||
|
||||||
|
profile.viewer?.blockingByList
|
||||||
|
|
||||||
const onPressEditProfile = React.useCallback(() => {
|
const onPressEditProfile = React.useCallback(() => {
|
||||||
track('ProfileHeader:EditProfileButtonClicked')
|
track('ProfileHeader:EditProfileButtonClicked')
|
||||||
|
@ -257,7 +261,7 @@ let ProfileHeaderStandard = ({
|
||||||
<ProfileHeaderDisplayName profile={profile} moderation={moderation} />
|
<ProfileHeaderDisplayName profile={profile} moderation={moderation} />
|
||||||
<ProfileHeaderHandle profile={profile} />
|
<ProfileHeaderHandle profile={profile} />
|
||||||
</View>
|
</View>
|
||||||
{!isPlaceholderProfile && (
|
{!isPlaceholderProfile && !isBlockedUser && (
|
||||||
<>
|
<>
|
||||||
<ProfileHeaderMetrics profile={profile} />
|
<ProfileHeaderMetrics profile={profile} />
|
||||||
{descriptionRT && !moderation.ui('profileView').blur ? (
|
{descriptionRT && !moderation.ui('profileView').blur ? (
|
||||||
|
@ -274,6 +278,7 @@ let ProfileHeaderStandard = ({
|
||||||
) : undefined}
|
) : undefined}
|
||||||
|
|
||||||
{!isMe &&
|
{!isMe &&
|
||||||
|
!isBlockedUser &&
|
||||||
shouldShowKnownFollowers(profile.viewer?.knownFollowers) && (
|
shouldShowKnownFollowers(profile.viewer?.knownFollowers) && (
|
||||||
<View style={[a.flex_row, a.align_center, a.gap_sm, a.pt_md]}>
|
<View style={[a.flex_row, a.align_center, a.gap_sm, a.pt_md]}>
|
||||||
<KnownFollowers
|
<KnownFollowers
|
||||||
|
|
|
@ -415,12 +415,14 @@ export const ComposePost = observer(function ComposePost({
|
||||||
bottomBarAnimatedStyle,
|
bottomBarAnimatedStyle,
|
||||||
} = useAnimatedBorders()
|
} = useAnimatedBorders()
|
||||||
|
|
||||||
|
const keyboardVerticalOffset = useKeyboardVerticalOffset()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<KeyboardAvoidingView
|
<KeyboardAvoidingView
|
||||||
testID="composePostView"
|
testID="composePostView"
|
||||||
behavior={isIOS ? 'padding' : 'height'}
|
behavior={isIOS ? 'padding' : 'height'}
|
||||||
keyboardVerticalOffset={isIOS ? 70 : 0}
|
keyboardVerticalOffset={keyboardVerticalOffset}
|
||||||
style={[a.flex_1]}>
|
style={a.flex_1}>
|
||||||
<View style={[a.flex_1, viewStyles]} aria-modal accessibilityViewIsModal>
|
<View style={[a.flex_1, viewStyles]} aria-modal accessibilityViewIsModal>
|
||||||
<Animated.View style={topBarAnimatedStyle}>
|
<Animated.View style={topBarAnimatedStyle}>
|
||||||
<View style={styles.topbarInner}>
|
<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({
|
const styles = StyleSheet.create({
|
||||||
topbarInner: {
|
topbarInner: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
|
|
Loading…
Reference in New Issue