diff --git a/src/components/live/LiveStatusDialog.tsx b/src/components/live/LiveStatusDialog.tsx index 086f0759c..782c25e9e 100644 --- a/src/components/live/LiveStatusDialog.tsx +++ b/src/components/live/LiveStatusDialog.tsx @@ -32,11 +32,13 @@ export function LiveStatusDialog({ profile, embed, status, + onPressViewAvatar, }: { control: Dialog.DialogControlProps profile: bsky.profile.AnyProfileView status: AppBskyActorDefs.StatusView embed: AppBskyEmbedExternal.View + onPressViewAvatar?: () => void }) { const navigation = useNavigation() return ( @@ -47,6 +49,7 @@ export function LiveStatusDialog({ profile={profile} embed={embed} navigation={navigation} + onPressViewAvatar={onPressViewAvatar} /> ) @@ -57,11 +60,13 @@ function DialogInner({ embed, navigation, status, + onPressViewAvatar, }: { profile: bsky.profile.AnyProfileView embed: AppBskyEmbedExternal.View navigation: NavigationProp status: AppBskyActorDefs.StatusView + onPressViewAvatar?: () => void }) { const {_} = useLingui() const control = Dialog.useDialogContext() @@ -74,6 +79,12 @@ function DialogInner({ }) }, [navigation, profile.handle, control]) + const handlePressViewAvatar = useCallback(() => { + if (onPressViewAvatar) { + control.close(onPressViewAvatar) + } + }, [control, onPressViewAvatar]) + return ( @@ -96,12 +108,14 @@ export function LiveStatus({ embed, padding = 'xl', onPressOpenProfile, + onPressViewAvatar, }: { status: AppBskyActorDefs.StatusView profile: bsky.profile.AnyProfileView embed: AppBskyEmbedExternal.View padding?: 'lg' | 'xl' onPressOpenProfile: () => void + onPressViewAvatar?: () => void }) { const {_} = useLingui() const t = useTheme() @@ -202,21 +216,36 @@ export function LiveStatus({ /> diff --git a/src/logger/metrics.ts b/src/logger/metrics.ts index 7afe7f3bb..5fa138197 100644 --- a/src/logger/metrics.ts +++ b/src/logger/metrics.ts @@ -374,7 +374,6 @@ export type MetricEvents = { | 'AvatarButton' | 'StarterPackProfilesList' | 'FeedInterstitial' - | 'ProfileHeaderSuggestedFollows' | 'PostOnboardingFindFollows' | 'ImmersiveVideo' | 'ExploreSuggestedAccounts' @@ -468,7 +467,6 @@ export type MetricEvents = { | 'AvatarButton' | 'StarterPackProfilesList' | 'FeedInterstitial' - | 'ProfileHeaderSuggestedFollows' | 'PostOnboardingFindFollows' | 'ImmersiveVideo' | 'ExploreSuggestedAccounts' @@ -632,6 +630,7 @@ export type MetricEvents = { 'live:card:open': {subject: string; from: 'post' | 'profile'} 'live:card:watch': {subject: string} 'live:card:openProfile': {subject: string} + 'live:card:viewAvatar': {subject: string} 'live:view:profile': {subject: string} 'live:view:post': {subject: string; feed?: string} diff --git a/src/screens/Profile/Header/Shell.tsx b/src/screens/Profile/Header/Shell.tsx index f195b4701..3a9d41395 100644 --- a/src/screens/Profile/Header/Shell.tsx +++ b/src/screens/Profile/Header/Shell.tsx @@ -266,7 +266,6 @@ let ProfileHeaderShell = ({ banner={profile.banner} moderation={moderation.ui('banner')} /> - {live.isActive && } @@ -348,6 +347,17 @@ let ProfileHeaderShell = ({ status={live} embed={live.embed} profile={profile} + onPressViewAvatar={() => { + const modui = moderation.ui('avatar') + const avatar = profile.avatar + if (avatar && !(modui.blur && modui.noOverride)) { + runOnUI(() => { + 'worklet' + const rect = measure(aviRef) + runOnJS(_openLightbox)(avatar, rect) + })() + } + }} /> ))}