Skip to content

Commit

Permalink
refactor: replace prefetchFlashList with PrefetchFlatList on rails (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
gkartalis authored Nov 20, 2024
1 parent 8c2b41c commit 21b239c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/app/Components/ArtworkRail/ArtworkRail.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
import { Box, Flex, SkeletonBox, SkeletonText, Spacer } from "@artsy/palette-mobile"
import { ListRenderItem } from "@shopify/flash-list"
import {
ArtworkRail_artworks$data,
ArtworkRail_artworks$key,
} from "__generated__/ArtworkRail_artworks.graphql"
import {
ARTWORK_RAIL_CARD_MINIMUM_WIDTH,
ArtworkRailCard,
} from "app/Components/ArtworkRail/ArtworkRailCard"
import { ArtworkRailCard } from "app/Components/ArtworkRail/ArtworkRailCard"
import {
ARTWORK_RAIL_CARD_IMAGE_HEIGHT,
ARTWORK_RAIL_MIN_IMAGE_WIDTH,
} from "app/Components/ArtworkRail/ArtworkRailCardImage"
import { LEGACY_ARTWORK_RAIL_CARD_IMAGE_HEIGHT } from "app/Components/ArtworkRail/LegacyArtworkRailCardImage"
import { BrowseMoreRailCard } from "app/Components/BrowseMoreRailCard"
import { PrefetchFlashList } from "app/Components/PrefetchFlashList"
import { PrefetchFlatList } from "app/Components/PrefetchFlatList"
import { useFeatureFlag } from "app/utils/hooks/useFeatureFlag"
import { RandomWidthPlaceholderText } from "app/utils/placeholders"
import { ArtworkActionTrackingProps } from "app/utils/track/ArtworkActions"
import React, { ReactElement, useCallback } from "react"
import { FlatList, ViewabilityConfig } from "react-native"
import { FlatList, ListRenderItem, ViewabilityConfig } from "react-native"
import { isTablet } from "react-native-device-info"
import { graphql, useFragment } from "react-relay"

Expand Down Expand Up @@ -91,9 +87,8 @@ export const ArtworkRail: React.FC<ArtworkRailProps> = ({
[hideArtistName, onPress, showPartnerName]
)
return (
<PrefetchFlashList
<PrefetchFlatList
data={artworks}
estimatedItemSize={ARTWORK_RAIL_CARD_MINIMUM_WIDTH}
horizontal
keyExtractor={(item) => item.internalID}
ListFooterComponent={
Expand Down

0 comments on commit 21b239c

Please sign in to comment.