Allow scroll by dragging profile header (#2068)

This commit is contained in:
dan 2023-12-04 20:03:32 +00:00 committed by GitHub
parent 9562a80908
commit a687d3f028
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 16 deletions

View file

@ -254,11 +254,14 @@ let PagerTabBar = ({
})) }))
return ( return (
<Animated.View <Animated.View
pointerEvents="box-none"
style={[ style={[
isMobile ? styles.tabBarMobile : styles.tabBarDesktop, isMobile ? styles.tabBarMobile : styles.tabBarDesktop,
headerTransform, headerTransform,
]}> ]}>
<View onLayout={onHeaderOnlyLayout}>{renderHeader?.()}</View> <View onLayout={onHeaderOnlyLayout} pointerEvents="box-none">
{renderHeader?.()}
</View>
<View <View
onLayout={onTabBarLayout} onLayout={onTabBarLayout}
style={{ style={{

View file

@ -412,10 +412,12 @@ let ProfileHeaderLoaded = ({
const pluralizedFollowers = pluralize(profile.followersCount || 0, 'follower') const pluralizedFollowers = pluralize(profile.followersCount || 0, 'follower')
return ( return (
<View style={pal.view}> <View style={pal.view} pointerEvents="box-none">
<UserBanner banner={profile.banner} moderation={moderation.avatar} /> <View pointerEvents="none">
<View style={styles.content}> <UserBanner banner={profile.banner} moderation={moderation.avatar} />
<View style={[styles.buttonsLine]}> </View>
<View style={styles.content} pointerEvents="box-none">
<View style={[styles.buttonsLine]} pointerEvents="box-none">
{isMe ? ( {isMe ? (
<TouchableOpacity <TouchableOpacity
testID="profileHeaderEditProfileButton" testID="profileHeaderEditProfileButton"
@ -525,7 +527,7 @@ let ProfileHeaderLoaded = ({
</NativeDropdown> </NativeDropdown>
) : undefined} ) : undefined}
</View> </View>
<View> <View pointerEvents="none">
<Text <Text
testID="profileHeaderDisplayName" testID="profileHeaderDisplayName"
type="title-2xl" type="title-2xl"
@ -536,7 +538,7 @@ let ProfileHeaderLoaded = ({
)} )}
</Text> </Text>
</View> </View>
<View style={styles.handleLine}> <View style={styles.handleLine} pointerEvents="none">
{profile.viewer?.followedBy && !blockHide ? ( {profile.viewer?.followedBy && !blockHide ? (
<View style={[styles.pill, pal.btn, s.mr5]}> <View style={[styles.pill, pal.btn, s.mr5]}>
<Text type="xs" style={[pal.text]}> <Text type="xs" style={[pal.text]}>
@ -557,7 +559,7 @@ let ProfileHeaderLoaded = ({
</View> </View>
{!blockHide && ( {!blockHide && (
<> <>
<View style={styles.metricsLine}> <View style={styles.metricsLine} pointerEvents="box-none">
<Link <Link
testID="profileHeaderFollowersButton" testID="profileHeaderFollowersButton"
style={[s.flexRow, s.mr10]} style={[s.flexRow, s.mr10]}
@ -604,12 +606,14 @@ let ProfileHeaderLoaded = ({
</Text> </Text>
</View> </View>
{descriptionRT && !moderation.profile.blur ? ( {descriptionRT && !moderation.profile.blur ? (
<RichText <View pointerEvents="none">
testID="profileHeaderDescription" <RichText
style={[styles.description, pal.text]} testID="profileHeaderDescription"
numberOfLines={15} style={[styles.description, pal.text]}
richText={descriptionRT} numberOfLines={15}
/> richText={descriptionRT}
/>
</View>
) : undefined} ) : undefined}
</> </>
)} )}

View file

@ -70,15 +70,19 @@ export function ProfileHeaderSuggestedFollows({
}) })
return ( return (
<Animated.View style={[{overflow: 'hidden', opacity: 0}, animatedStyles]}> <Animated.View
<View style={{paddingVertical: OUTER_PADDING}}> pointerEvents="box-none"
style={[{overflow: 'hidden', opacity: 0}, animatedStyles]}>
<View style={{paddingVertical: OUTER_PADDING}} pointerEvents="box-none">
<View <View
pointerEvents="box-none"
style={{ style={{
backgroundColor: pal.viewLight.backgroundColor, backgroundColor: pal.viewLight.backgroundColor,
height: '100%', height: '100%',
paddingTop: INNER_PADDING / 2, paddingTop: INNER_PADDING / 2,
}}> }}>
<View <View
pointerEvents="box-none"
style={{ style={{
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'space-between', justifyContent: 'space-between',