Skip to content

Commit

Permalink
chore(tracking): Add generic tap event for read more taps on artwork …
Browse files Browse the repository at this point in the history
…details (#10202)

Total WIP: add generic tap event for read more taps on artwork details
  • Loading branch information
jpotts244 authored May 6, 2024
1 parent e0fd9e2 commit c141854
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/app/Scenes/Artwork/Components/ArtworkDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ import { Spacer, Flex, Box, Text, Join } from "@artsy/palette-mobile"
import { ArtworkDetails_artwork$key } from "__generated__/ArtworkDetails_artwork.graphql"
import { GlobalStore } from "app/store/GlobalStore"
import { navigate } from "app/system/navigation/navigate"
import { Schema } from "app/utils/track"
import React from "react"
import { TouchableWithoutFeedback } from "react-native"
import { graphql, useFragment } from "react-relay"
import { useTracking } from "react-tracking"
import { ArtworkDetailsRow } from "./ArtworkDetailsRow"
import { RequestConditionReportQueryRenderer } from "./RequestConditionReport"

Expand Down Expand Up @@ -105,6 +107,19 @@ export const ArtworkDetails: React.FC<ArtworkDetailsProps> = ({

const displayItems = isCollapsed ? allDisplayItems.slice(0, COLLAPSED_COUNT) : allDisplayItems

const { trackEvent } = useTracking()

const handleReadMoreTap = () => {
const properties = {
action_type: Schema.ActionTypes.Tap,
context_module: "artworkDetails",
subject: "Read more",
type: "Link",
}
trackEvent(properties)
setIsCollapsed(false)
}

if (!displayItems.length) {
return null
}
Expand All @@ -123,7 +138,7 @@ export const ArtworkDetails: React.FC<ArtworkDetailsProps> = ({
color="black100"
textAlign="center"
underline
onPress={() => setIsCollapsed(false)}
onPress={() => handleReadMoreTap()}
>
Read More
</Text>
Expand Down

0 comments on commit c141854

Please sign in to comment.