[Statsig] Track likes, reposts, follows (#3195)
* [Statsig] Track likes * Move tracking to intent * Track repost/unrepost * Track profile follows/unfollows * Less copy paste * Reorder
This commit is contained in:
parent
db79c918b2
commit
7eaa573b57
15 changed files with 125 additions and 30 deletions
|
@ -13,13 +13,18 @@ export function FollowButton({
|
|||
followedType = 'default',
|
||||
profile,
|
||||
labelStyle,
|
||||
logContext,
|
||||
}: {
|
||||
unfollowedType?: ButtonType
|
||||
followedType?: ButtonType
|
||||
profile: Shadow<AppBskyActorDefs.ProfileViewBasic>
|
||||
labelStyle?: StyleProp<TextStyle>
|
||||
logContext: 'ProfileCard'
|
||||
}) {
|
||||
const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue(profile)
|
||||
const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue(
|
||||
profile,
|
||||
logContext,
|
||||
)
|
||||
const {_} = useLingui()
|
||||
|
||||
const onPressFollow = async () => {
|
||||
|
|
|
@ -230,7 +230,9 @@ export function ProfileCardWithFollowBtn({
|
|||
renderButton={
|
||||
isMe
|
||||
? undefined
|
||||
: profileShadow => <FollowButton profile={profileShadow} />
|
||||
: profileShadow => (
|
||||
<FollowButton profile={profileShadow} logContext="ProfileCard" />
|
||||
)
|
||||
}
|
||||
/>
|
||||
)
|
||||
|
|
|
@ -103,7 +103,10 @@ let ProfileHeader = ({
|
|||
const invalidHandle = isInvalidHandle(profile.handle)
|
||||
const {isDesktop} = useWebMediaQueries()
|
||||
const [showSuggestedFollows, setShowSuggestedFollows] = React.useState(false)
|
||||
const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue(profile)
|
||||
const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue(
|
||||
profile,
|
||||
'ProfileHeader',
|
||||
)
|
||||
const [__, queueUnblock] = useProfileBlockMutationQueue(profile)
|
||||
const unblockPromptControl = Prompt.usePromptControl()
|
||||
const moderation = useMemo(
|
||||
|
|
|
@ -170,7 +170,10 @@ function SuggestedFollow({
|
|||
const pal = usePalette('default')
|
||||
const moderationOpts = useModerationOpts()
|
||||
const profile = useProfileShadow(profileUnshadowed)
|
||||
const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue(profile)
|
||||
const [queueFollow, queueUnfollow] = useProfileFollowMutationQueue(
|
||||
profile,
|
||||
'ProfileHeaderSuggestedFollows',
|
||||
)
|
||||
|
||||
const onPressFollow = React.useCallback(async () => {
|
||||
try {
|
||||
|
|
|
@ -52,7 +52,10 @@ let ProfileMenu = ({
|
|||
|
||||
const [queueMute, queueUnmute] = useProfileMuteMutationQueue(profile)
|
||||
const [queueBlock, queueUnblock] = useProfileBlockMutationQueue(profile)
|
||||
const [, queueUnfollow] = useProfileFollowMutationQueue(profile)
|
||||
const [, queueUnfollow] = useProfileFollowMutationQueue(
|
||||
profile,
|
||||
'ProfileMenu',
|
||||
)
|
||||
|
||||
const blockPromptControl = Prompt.usePromptControl()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue