Add basic analytics (#89)
* Add basic analytics * Fix: add mock for analytics
This commit is contained in:
parent
f36c956536
commit
21f5f4de15
9 changed files with 190 additions and 14 deletions
|
@ -17,6 +17,7 @@ import PasteInput, {
|
|||
} from '@mattermost/react-native-paste-input'
|
||||
import LinearGradient from 'react-native-linear-gradient'
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||
import {useAnalytics} from '@segment/analytics-react-native'
|
||||
import {UserAutocompleteViewModel} from '../../../state/models/user-autocomplete-view'
|
||||
import {Autocomplete} from './Autocomplete'
|
||||
import {ExternalEmbed} from './ExternalEmbed'
|
||||
|
@ -59,6 +60,7 @@ export const ComposePost = observer(function ComposePost({
|
|||
onPost?: ComposerOpts['onPost']
|
||||
onClose: () => void
|
||||
}) {
|
||||
const {track} = useAnalytics()
|
||||
const pal = usePalette('default')
|
||||
const store = useStores()
|
||||
const textInput = useRef<PasteInputRef>(null)
|
||||
|
@ -252,6 +254,9 @@ export const ComposePost = observer(function ComposePost({
|
|||
autocompleteView.knownHandles,
|
||||
setProcessingState,
|
||||
)
|
||||
track('Create Post', {
|
||||
imageCount: selectedPhotos.length,
|
||||
})
|
||||
} catch (e: any) {
|
||||
setError(cleanError(e.message))
|
||||
setIsProcessing(false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue