Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/screens/StarterPack/StarterPackScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ function Header({
isOwner={isOwn}
avatar={undefined}
creator={creator}
purpose="app.bsky.graph.defs#referencelist"
avatarType="starter-pack">
{hasSession ? (
<View style={[a.flex_row, a.gap_sm, a.align_center]}>
Expand Down
4 changes: 3 additions & 1 deletion src/view/com/pager/PagerWithHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
import {ScrollProvider} from '#/lib/ScrollContext'
import {isIOS} from '#/platform/detection'
import {Pager, PagerRef, RenderTabBarFnProps} from '#/view/com/pager/Pager'
import {useTheme} from '#/alf'
import {ListMethods} from '../util/List'
import {PagerHeaderProvider} from './PagerHeaderContext'
import {TabBar} from './TabBar'
Expand Down Expand Up @@ -256,6 +257,7 @@ let PagerTabBar = ({
dragProgress: SharedValue<number>
dragState: SharedValue<'idle' | 'dragging' | 'settling'>
}): React.ReactNode => {
const t = useTheme()
const [minimumHeaderHeight, setMinimumHeaderHeight] = React.useState(0)
const headerTransform = useAnimatedStyle(() => {
const translateY =
Expand All @@ -277,7 +279,7 @@ let PagerTabBar = ({
return (
<Animated.View
pointerEvents={isIOS ? 'auto' : 'box-none'}
style={[styles.tabBarMobile, headerTransform]}>
style={[styles.tabBarMobile, headerTransform, t.atoms.bg]}>

@gaearon gaearon Dec 13, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i was noticing scrollview content sometimes glitching appearing under the header, this makes the header always a solid color

<View
ref={headerRef}
pointerEvents={isIOS ? 'auto' : 'box-none'}
Expand Down
65 changes: 47 additions & 18 deletions src/view/com/profile/ProfileSubpageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import {Pressable, View} from 'react-native'
import {MeasuredDimensions, runOnJS, runOnUI} from 'react-native-reanimated'
import {AppBskyGraphDefs} from '@atproto/api'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {useNavigation} from '@react-navigation/native'
Expand All @@ -26,6 +27,7 @@ export function ProfileSubpageHeader({
title,
avatar,
isOwner,
purpose,
creator,
avatarType,
children,
Expand All @@ -35,6 +37,7 @@ export function ProfileSubpageHeader({
title: string | undefined
avatar: string | undefined
isOwner: boolean | undefined
purpose: AppBskyGraphDefs.ListPurpose | undefined
creator:
| {
did: string
Expand Down Expand Up @@ -105,7 +108,7 @@ export function ProfileSubpageHeader({
alignItems: 'flex-start',
gap: 10,
paddingTop: 14,
paddingBottom: 6,
paddingBottom: 14,
paddingHorizontal: isMobile ? 12 : 14,
}}>
<View ref={aviRef} collapsable={false}>
Expand All @@ -123,7 +126,7 @@ export function ProfileSubpageHeader({
)}
</Pressable>
</View>
<View style={{flex: 1}}>
<View style={{flex: 1, gap: 4}}>
{isLoading ? (
<LoadingPlaceholder
width={200}
Expand All @@ -142,24 +145,50 @@ export function ProfileSubpageHeader({
/>
)}

{isLoading ? (
{isLoading || !creator ? (
<LoadingPlaceholder width={50} height={8} />
) : (
<Text type="xl" style={[pal.textLight]} numberOfLines={1}>
{!creator ? (
<Trans>by —</Trans>
) : isOwner ? (
<Trans>by you</Trans>
) : (
<Trans>
by{' '}
<TextLink
text={sanitizeHandle(creator.handle, '@')}
href={makeProfileLink(creator)}
style={pal.textLight}
/>
</Trans>
)}
<Text type="lg" style={[pal.textLight]} numberOfLines={1}>
{purpose === 'app.bsky.graph.defs#curatelist' ? (
isOwner ? (
<Trans>List by you</Trans>
) : (
<Trans>
List by{' '}
<TextLink
text={sanitizeHandle(creator.handle || '', '@')}
href={makeProfileLink(creator)}
style={pal.textLight}
/>
</Trans>
)
) : purpose === 'app.bsky.graph.defs#modlist' ? (
isOwner ? (
<Trans>Moderation list by you</Trans>
) : (
<Trans>
Moderation list by{' '}
<TextLink
text={sanitizeHandle(creator.handle || '', '@')}
href={makeProfileLink(creator)}
style={pal.textLight}
/>
</Trans>
)
) : purpose === 'app.bsky.graph.defs#referencelist' ? (
isOwner ? (
<Trans>Starter pack by you</Trans>
) : (
<Trans>
Starter pack by{' '}
<TextLink
text={sanitizeHandle(creator.handle || '', '@')}
href={makeProfileLink(creator)}
style={pal.textLight}
/>
</Trans>
)
) : null}
</Text>
)}
</View>
Expand Down
Loading