Skip to content

fix(DIA-1314): don't show empty state while Discover Something New collection is loading #12099

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions src/app/Scenes/Collection/Collection.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { ShareIcon } from "@artsy/icons/native"
import {
Box,
Flex,
Screen,
Separator,
ShareIcon,
Skeleton,
SkeletonBox,
SkeletonText,
Expand All @@ -24,7 +24,7 @@ import { useFeatureFlag } from "app/utils/hooks/useFeatureFlag"
import { PlaceholderGrid } from "app/utils/placeholderGrid"
import { ProvideScreenTracking, Schema } from "app/utils/track"
import { isEmpty } from "lodash"
import { Suspense, useCallback } from "react"
import React, { Suspense, useCallback } from "react"
import { TouchableOpacity } from "react-native"
import RNShare from "react-native-share"
import { graphql, useFragment, useLazyLoadQuery } from "react-relay"
Expand Down Expand Up @@ -71,7 +71,7 @@ export const CollectionContent: React.FC<CollectionProps> = ({ collection }) =>
message: message + "\n" + url,
failOnCancel: true,
})
showToast("Copied to Clipboard", "middle", { Icon: ShareIcon })
showToast("Copied to Clipboard", "middle", { Icon: ShareIcon as React.FC })
} catch (error) {
if (typeof error === "string" && error.includes("User did not share")) {
console.error("Collection.tsx", error)
Expand Down Expand Up @@ -119,13 +119,7 @@ export const CollectionContent: React.FC<CollectionProps> = ({ collection }) =>
}

const CollectionQueryRenderer: React.FC<CollectionScreenProps> = ({ collectionID }) => {
const data = useLazyLoadQuery<CollectionQuery>(
CollectionScreenQuery,
{ collectionID },
{
fetchPolicy: "store-and-network",
}
)
const data = useLazyLoadQuery<CollectionQuery>(CollectionScreenQuery, { collectionID })

if (!data?.collection) {
return null
Expand Down Expand Up @@ -180,7 +174,7 @@ const CollectionPlaceholder: React.FC = () => {
}

export const CollectionScreenQuery = graphql`
query CollectionQuery($collectionID: String!) @cacheable {
query CollectionQuery($collectionID: String!) {
collection: marketingCollection(slug: $collectionID) @principalField {
...Collection_collection
}
Expand Down