closer...
This commit is contained in:
@@ -182,7 +182,10 @@ export function TitleText({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SubtitleText({children}: {children: React.ReactNode}) {
|
export function SubtitleText({
|
||||||
|
children,
|
||||||
|
style,
|
||||||
|
}: {children: React.ReactNode} & TextStyleProp) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const align = useContext(AlignmentContext)
|
const align = useContext(AlignmentContext)
|
||||||
return (
|
return (
|
||||||
@@ -192,6 +195,7 @@ export function SubtitleText({children}: {children: React.ReactNode}) {
|
|||||||
a.leading_snug,
|
a.leading_snug,
|
||||||
isIOS && align === 'platform' && a.text_center,
|
isIOS && align === 'platform' && a.text_center,
|
||||||
t.atoms.text_contrast_medium,
|
t.atoms.text_contrast_medium,
|
||||||
|
style,
|
||||||
]}
|
]}
|
||||||
numberOfLines={2}>
|
numberOfLines={2}>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
@@ -74,34 +74,35 @@ function GrowableBannerInner({
|
|||||||
const isFetching = useIsProfileFetching()
|
const isFetching = useIsProfileFetching()
|
||||||
const animateSpinner = useShouldAnimateSpinner({isFetching, scrollY})
|
const animateSpinner = useShouldAnimateSpinner({isFetching, scrollY})
|
||||||
|
|
||||||
const animatedStyle = useAnimatedStyle(() => ({
|
const animatedStyle = useAnimatedStyle(() => {
|
||||||
|
const scrollYValue = scrollY.get()
|
||||||
|
return {
|
||||||
|
zIndex: scrollYValue > 100 ? 100 : 0,
|
||||||
transform: [
|
transform: [
|
||||||
{
|
{
|
||||||
scale: interpolate(
|
scale: interpolate(
|
||||||
scrollY.get(),
|
scrollYValue,
|
||||||
[-150, 0],
|
[-150, 0],
|
||||||
[2, 1],
|
[2, 1],
|
||||||
Extrapolation.CLAMP,
|
Extrapolation.CLAMP,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
translateY: clamp(scrollY.get() - minimumHeaderHeight, 0, headerHeight),
|
translateY: clamp(
|
||||||
|
scrollYValue - minimumHeaderHeight + topInset,
|
||||||
|
0,
|
||||||
|
headerHeight - minimumHeaderHeight,
|
||||||
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}))
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const animatedBlurViewProps = useAnimatedProps(() => {
|
const animatedBlurViewProps = useAnimatedProps(() => {
|
||||||
console.log(
|
|
||||||
'scrollY',
|
|
||||||
scrollY.get(),
|
|
||||||
'headerHeight',
|
|
||||||
headerHeight,
|
|
||||||
topInset,
|
|
||||||
)
|
|
||||||
return {
|
return {
|
||||||
intensity: interpolate(
|
intensity: interpolate(
|
||||||
scrollY.get(),
|
scrollY.get(),
|
||||||
[-300, -65, -15, minimumHeaderHeight - 10, minimumHeaderHeight],
|
[-300, -65, -15, minimumHeaderHeight - 10, minimumHeaderHeight + 30],
|
||||||
[50, 40, 0, 0, 50],
|
[50, 40, 0, 0, 50],
|
||||||
{extrapolateLeft: Extrapolation.CLAMP},
|
{extrapolateLeft: Extrapolation.CLAMP},
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ const MinimalHeader = React.memo(function MinimalHeader({
|
|||||||
profile: AppBskyActorDefs.ProfileViewDetailed
|
profile: AppBskyActorDefs.ProfileViewDetailed
|
||||||
hideBackButton?: boolean
|
hideBackButton?: boolean
|
||||||
}) {
|
}) {
|
||||||
|
const t = useTheme()
|
||||||
const insets = useSafeAreaInsets()
|
const insets = useSafeAreaInsets()
|
||||||
const ctx = usePagerHeaderContext()
|
const ctx = usePagerHeaderContext()
|
||||||
const [visible, setVisible] = useState(false)
|
const [visible, setVisible] = useState(false)
|
||||||
@@ -163,10 +164,16 @@ const MinimalHeader = React.memo(function MinimalHeader({
|
|||||||
<Header.Outer>
|
<Header.Outer>
|
||||||
{!hideBackButton && <Header.BackButton />}
|
{!hideBackButton && <Header.BackButton />}
|
||||||
<Header.Content align="left">
|
<Header.Content align="left">
|
||||||
<Header.TitleText>
|
<Header.TitleText style={{color: t.palette.white}}>
|
||||||
{sanitizeDisplayName(profile.displayName || profile.handle)}
|
{sanitizeDisplayName(profile.displayName || profile.handle)}
|
||||||
</Header.TitleText>
|
</Header.TitleText>
|
||||||
<Header.SubtitleText>
|
<Header.SubtitleText
|
||||||
|
style={{
|
||||||
|
color:
|
||||||
|
t.scheme === 'light'
|
||||||
|
? t.palette.contrast_700
|
||||||
|
: t.palette.contrast_300,
|
||||||
|
}}>
|
||||||
{sanitizeHandle(profile.handle, '@')}
|
{sanitizeHandle(profile.handle, '@')}
|
||||||
</Header.SubtitleText>
|
</Header.SubtitleText>
|
||||||
</Header.Content>
|
</Header.Content>
|
||||||
|
|||||||
Reference in New Issue
Block a user