import analytics from '@components/analytics' import GracefullyImage from '@components/GracefullyImage' import { useNavigation } from '@react-navigation/native' import { StackNavigationProp } from '@react-navigation/stack' import { QueryKeyTimeline } from '@utils/queryHooks/timeline' import { StyleConstants } from '@utils/styles/constants' import React, { useCallback } from 'react' import { useTranslation } from 'react-i18next' export interface Props { queryKey?: QueryKeyTimeline account: Mastodon.Account highlighted: boolean } const TimelineAvatar = React.memo( ({ queryKey, account, highlighted }: Props) => { const { t } = useTranslation('componentTimeline') const navigation = useNavigation< StackNavigationProp >() // Need to fix go back root const onPress = useCallback(() => { analytics('timeline_shared_avatar_press', { page: queryKey && queryKey[1].page }) queryKey && navigation.push('Tab-Shared-Account', { account }) }, []) return ( ) }, () => true ) export default TimelineAvatar