diff --git a/src/app/Scenes/HomeViewSectionScreen/HomeViewSectionScreenArtworks.tests.tsx b/src/app/Scenes/HomeViewSectionScreen/HomeViewSectionScreenArtworks.tests.tsx index a7388c2f786..ffa394e6d78 100644 --- a/src/app/Scenes/HomeViewSectionScreen/HomeViewSectionScreenArtworks.tests.tsx +++ b/src/app/Scenes/HomeViewSectionScreen/HomeViewSectionScreenArtworks.tests.tsx @@ -53,6 +53,7 @@ describe("HomeViewSectionArtworks", () => { component: { title: "New Works for You", }, + ownerType: "newWorksForYou", artworksConnection: { edges: [ { @@ -89,9 +90,9 @@ describe("HomeViewSectionArtworks", () => { "action": "tappedMainArtworkGrid", "context_module": "artworkGrid", "context_screen": undefined, - "context_screen_owner_id": "home-view-section-new-works-for-you", + "context_screen_owner_id": undefined, "context_screen_owner_slug": undefined, - "context_screen_owner_type": "home-view-section-new-works-for-you", + "context_screen_owner_type": "newWorksForYou", "destination_screen_owner_id": "artwork-2-id", "destination_screen_owner_slug": "artwork-2-slug", "destination_screen_owner_type": "artwork", diff --git a/src/app/Scenes/HomeViewSectionScreen/HomeViewSectionScreenArtworks.tsx b/src/app/Scenes/HomeViewSectionScreen/HomeViewSectionScreenArtworks.tsx index 9f2fdb8a618..42d5972932b 100644 --- a/src/app/Scenes/HomeViewSectionScreen/HomeViewSectionScreenArtworks.tsx +++ b/src/app/Scenes/HomeViewSectionScreen/HomeViewSectionScreenArtworks.tsx @@ -1,4 +1,4 @@ -import { ContextModule, ScreenOwnerType } from "@artsy/cohesion" +import { ScreenOwnerType } from "@artsy/cohesion" import { Flex, Screen, SimpleMessage, Text } from "@artsy/palette-mobile" import { HomeViewSectionScreenArtworksQuery } from "__generated__/HomeViewSectionScreenArtworksQuery.graphql" import { HomeViewSectionScreenArtworks_section$key } from "__generated__/HomeViewSectionScreenArtworks_section.graphql" @@ -15,12 +15,18 @@ interface ArtworksScreenHomeSection { } export const HomeViewSectionScreenArtworks: React.FC = (props) => { - const { data, isLoadingNext, loadNext, refetch, hasNext } = usePaginationFragment< + const { + data: section, + isLoadingNext, + loadNext, + refetch, + hasNext, + } = usePaginationFragment< HomeViewSectionScreenArtworksQuery, HomeViewSectionScreenArtworks_section$key >(artworksFragment, props.section) - const artworks = extractNodes(data?.artworksConnection) + const artworks = extractNodes(section?.artworksConnection) const RefreshControl = useRefreshControl(refetch) @@ -38,9 +44,9 @@ export const HomeViewSectionScreenArtworks: React.FC } ListHeaderComponent={() => ( - {data.component?.title} + {section.component?.title} - {data.artworksConnection?.totalCount} {pluralize("Artwork", artworks.length)} + {section.artworksConnection?.totalCount} {pluralize("Artwork", artworks.length)} )} @@ -52,9 +58,7 @@ export const HomeViewSectionScreenArtworks: React.FC isLoading={isLoadingNext} onScroll={scrollHandler} style={{ paddingBottom: 120 }} - contextModule={data.internalID as ContextModule} - contextScreenOwnerType={data.internalID as ScreenOwnerType} - contextScreenOwnerId={data.internalID as string} + contextScreenOwnerType={section.ownerType as ScreenOwnerType} /> ) }