fix issue where recent artists were cut off on the home screen

This commit is contained in:
Violet Caulfield
2025-09-18 17:26:07 -05:00
parent 5921ed715b
commit 08a28aa5ee
2 changed files with 4 additions and 24 deletions

View File

@@ -1,11 +1,10 @@
import HorizontalCardList from '../../../components/Global/components/horizontal-list'
import { NativeStackNavigationProp } from '@react-navigation/native-stack'
import React, { useCallback, useMemo } from 'react'
import React, { useCallback } from 'react'
import { ItemCard } from '../../../components/Global/components/item-card'
import { useTheme, View, XStack } from 'tamagui'
import { H4, Text } from '../../../components/Global/helpers/text'
import { View, XStack } from 'tamagui'
import { H4 } from '../../../components/Global/helpers/text'
import Icon from '../../Global/components/icon'
import { ActivityIndicator } from 'react-native'
import { useDisplayContext } from '../../../providers/Display/display-provider'
import { useNavigation } from '@react-navigation/native'
import HomeStackParamList from '../../../screens/Home/types'
@@ -18,7 +17,6 @@ export default function FrequentArtists(): React.JSX.Element {
const rootNavigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>()
const frequentArtistsInfiniteQuery = useFrequentlyPlayedArtists()
const theme = useTheme()
const { horizontalItems } = useDisplayContext()
const renderItem = useCallback(
@@ -60,15 +58,6 @@ export default function FrequentArtists(): React.JSX.Element {
<HorizontalCardList
data={frequentArtistsInfiniteQuery.data?.slice(0, horizontalItems) ?? []}
renderItem={renderItem}
ListEmptyComponent={
<View flex={1} justifyContent='center' alignItems='center' height={'$11'}>
{frequentArtistsInfiniteQuery.isLoading ? (
<ActivityIndicator color={theme.primary.val} />
) : (
<Text>No frequent artists</Text>
)}
</View>
}
/>
</View>
)

View File

@@ -1,13 +1,12 @@
import React from 'react'
import { View, XStack } from 'tamagui'
import { H4, Text } from '../../Global/helpers/text'
import { H4 } from '../../Global/helpers/text'
import { RootStackParamList } from '../../../screens/types'
import { ItemCard } from '../../Global/components/item-card'
import { NativeStackNavigationProp } from '@react-navigation/native-stack'
import HorizontalCardList from '../../../components/Global/components/horizontal-list'
import Icon from '../../Global/components/icon'
import { useDisplayContext } from '../../../providers/Display/display-provider'
import { ActivityIndicator } from 'react-native'
import { useNavigation } from '@react-navigation/native'
import HomeStackParamList from '../../../screens/Home/types'
import { useRecentArtists } from '../../../api/queries/recents'
@@ -54,14 +53,6 @@ export default function RecentArtists(): React.JSX.Element {
size={'$10'}
></ItemCard>
)}
ListEmptyComponent={
recentArtistsInfiniteQuery.isFetching ||
recentArtistsInfiniteQuery.isPending ? (
<ActivityIndicator />
) : (
<Text>No recent artists</Text>
)
}
/>
</View>
)