diff options
author | Hailey <me@haileyok.com> | 2024-09-27 14:01:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-27 14:01:57 -0700 |
commit | f68b15219fd02e23d965015201400138ed69d59d (patch) | |
tree | 1134642fff8db10b2cfca827a6c0d9cd2a4dbd5b /src/view/com/lists | |
parent | bcd096b85aee45c38de7cfbcf1115b0a544589ae (diff) | |
download | voidsky-f68b15219fd02e23d965015201400138ed69d59d.tar.zst |
Remove Segment (#5518)
Diffstat (limited to 'src/view/com/lists')
-rw-r--r-- | src/view/com/lists/ListMembers.tsx | 31 | ||||
-rw-r--r-- | src/view/com/lists/MyLists.tsx | 15 | ||||
-rw-r--r-- | src/view/com/lists/ProfileLists.tsx | 9 |
3 files changed, 22 insertions, 33 deletions
diff --git a/src/view/com/lists/ListMembers.tsx b/src/view/com/lists/ListMembers.tsx index 4f2b56426..cf7bb6b9e 100644 --- a/src/view/com/lists/ListMembers.tsx +++ b/src/view/com/lists/ListMembers.tsx @@ -7,21 +7,21 @@ import { ViewStyle, } from 'react-native' import {AppBskyActorDefs, AppBskyGraphDefs} from '@atproto/api' -import {List, ListRef} from '../util/List' -import {ProfileCardFeedLoadingPlaceholder} from '../util/LoadingPlaceholder' -import {ErrorMessage} from '../util/error/ErrorMessage' -import {LoadMoreRetryBtn} from '../util/LoadMoreRetryBtn' -import {ProfileCard} from '../profile/ProfileCard' -import {Button} from '../util/forms/Button' -import {useAnalytics} from 'lib/analytics/analytics' -import {useWebMediaQueries} from 'lib/hooks/useWebMediaQueries' -import {useListMembersQuery} from '#/state/queries/list-members' +import {msg} from '@lingui/macro' +import {useLingui} from '@lingui/react' + +import {useWebMediaQueries} from '#/lib/hooks/useWebMediaQueries' +import {cleanError} from '#/lib/strings/errors' import {logger} from '#/logger' import {useModalControls} from '#/state/modals' +import {useListMembersQuery} from '#/state/queries/list-members' import {useSession} from '#/state/session' -import {cleanError} from '#/lib/strings/errors' -import {useLingui} from '@lingui/react' -import {msg} from '@lingui/macro' +import {ProfileCard} from '../profile/ProfileCard' +import {ErrorMessage} from '../util/error/ErrorMessage' +import {Button} from '../util/forms/Button' +import {List, ListRef} from '../util/List' +import {ProfileCardFeedLoadingPlaceholder} from '../util/LoadingPlaceholder' +import {LoadMoreRetryBtn} from '../util/LoadMoreRetryBtn' const LOADING_ITEM = {_reactKey: '__loading__'} const EMPTY_ITEM = {_reactKey: '__empty__'} @@ -51,7 +51,6 @@ export function ListMembers({ headerOffset?: number desktopFixedHeightOffset?: number }) { - const {track} = useAnalytics() const {_} = useLingui() const [isRefreshing, setIsRefreshing] = React.useState(false) const {isMobile} = useWebMediaQueries() @@ -98,7 +97,6 @@ export function ListMembers({ // = const onRefresh = React.useCallback(async () => { - track('Lists:onRefresh') setIsRefreshing(true) try { await refetch() @@ -106,17 +104,16 @@ export function ListMembers({ logger.error('Failed to refresh lists', {message: err}) } setIsRefreshing(false) - }, [refetch, track, setIsRefreshing]) + }, [refetch, setIsRefreshing]) const onEndReached = React.useCallback(async () => { if (isFetching || !hasNextPage || isError) return - track('Lists:onEndReached') try { await fetchNextPage() } catch (err) { logger.error('Failed to load more lists', {message: err}) } - }, [isFetching, hasNextPage, isError, fetchNextPage, track]) + }, [isFetching, hasNextPage, isError, fetchNextPage]) const onPressRetryLoadMore = React.useCallback(() => { fetchNextPage() diff --git a/src/view/com/lists/MyLists.tsx b/src/view/com/lists/MyLists.tsx index b56fa6c75..363dd100d 100644 --- a/src/view/com/lists/MyLists.tsx +++ b/src/view/com/lists/MyLists.tsx @@ -11,15 +11,14 @@ import {AppBskyGraphDefs as GraphDefs} from '@atproto/api' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' +import {usePalette} from '#/lib/hooks/usePalette' import {cleanError} from '#/lib/strings/errors' +import {s} from '#/lib/styles' import {logger} from '#/logger' +import {isWeb} from '#/platform/detection' +import {useModerationOpts} from '#/state/preferences/moderation-opts' import {MyListsFilter, useMyListsQuery} from '#/state/queries/my-lists' -import {useAnalytics} from 'lib/analytics/analytics' -import {usePalette} from 'lib/hooks/usePalette' -import {s} from 'lib/styles' -import {isWeb} from 'platform/detection' -import {useModerationOpts} from 'state/preferences/moderation-opts' -import {EmptyState} from 'view/com/util/EmptyState' +import {EmptyState} from '#/view/com/util/EmptyState' import {atoms as a, useTheme} from '#/alf' import * as ListCard from '#/components/ListCard' import {ErrorMessage} from '../util/error/ErrorMessage' @@ -44,7 +43,6 @@ export function MyLists({ }) { const pal = usePalette('default') const t = useTheme() - const {track} = useAnalytics() const {_} = useLingui() const moderationOpts = useModerationOpts() const [isPTRing, setIsPTRing] = React.useState(false) @@ -71,7 +69,6 @@ export function MyLists({ // = const onRefresh = React.useCallback(async () => { - track('Lists:onRefresh') setIsPTRing(true) try { await refetch() @@ -79,7 +76,7 @@ export function MyLists({ logger.error('Failed to refresh lists', {message: err}) } setIsPTRing(false) - }, [refetch, track, setIsPTRing]) + }, [refetch, setIsPTRing]) // rendering // = diff --git a/src/view/com/lists/ProfileLists.tsx b/src/view/com/lists/ProfileLists.tsx index 117164413..27b7f94df 100644 --- a/src/view/com/lists/ProfileLists.tsx +++ b/src/view/com/lists/ProfileLists.tsx @@ -10,7 +10,6 @@ import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' import {useQueryClient} from '@tanstack/react-query' -import {useAnalytics} from '#/lib/analytics/analytics' import {cleanError} from '#/lib/strings/errors' import {logger} from '#/logger' import {isNative, isWeb} from '#/platform/detection' @@ -48,7 +47,6 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>( ref, ) { const t = useTheme() - const {track} = useAnalytics() const {_} = useLingui() const [isPTRing, setIsPTRing] = React.useState(false) const opts = React.useMemo(() => ({enabled}), [enabled]) @@ -102,7 +100,6 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>( })) const onRefresh = React.useCallback(async () => { - track('Lists:onRefresh') setIsPTRing(true) try { await refetch() @@ -110,18 +107,16 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>( logger.error('Failed to refresh lists', {message: err}) } setIsPTRing(false) - }, [refetch, track, setIsPTRing]) + }, [refetch, setIsPTRing]) const onEndReached = React.useCallback(async () => { if (isFetching || !hasNextPage || isError) return - - track('Lists:onEndReached') try { await fetchNextPage() } catch (err) { logger.error('Failed to load more lists', {message: err}) } - }, [isFetching, hasNextPage, isError, fetchNextPage, track]) + }, [isFetching, hasNextPage, isError, fetchNextPage]) const onPressRetryLoadMore = React.useCallback(() => { fetchNextPage() |