Skip to content

Commit

Permalink
chore: hide view follows link on the toast on the onboarding grid (#1…
Browse files Browse the repository at this point in the history
…1159)

* fix: hide view follows link on onboarding grid

* chore

* chore: remove description as well
  • Loading branch information
dariakoko authored Nov 21, 2024
1 parent d914193 commit ebf9efd
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
26 changes: 17 additions & 9 deletions src/app/Components/Artist/useFollowArtist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface Options {
contextModule?: ContextModule
contextScreenOwnerType?: OwnerType
ownerType?: Schema.OwnerEntityTypes | OwnerType
hideViewFollowsLink?: boolean
}

export const useFollowArtist = (options: Options) => {
Expand All @@ -23,6 +24,7 @@ export const useFollowArtist = (options: Options) => {
contextModule,
contextScreenOwnerType = Schema.OwnerEntityTypes.Artist,
ownerType,
hideViewFollowsLink,
} = options

const [isLoading, setIsLoading] = useState(false)
Expand Down Expand Up @@ -119,15 +121,21 @@ export const useFollowArtist = (options: Options) => {
setIsLoading(false)

if (showToast && !data.isFollowed) {
toast.show("Artist Followed", "bottom", {
cta: "View Follows",
onPress: () => {
switchTab("profile")
navigate("favorites")
},
backgroundColor: "green100",
description: "Keep track of the artists you love",
})
if (hideViewFollowsLink) {
toast.show("Artist Followed", "bottom", {
backgroundColor: "green100",
})
} else {
toast.show("Artist Followed", "bottom", {
cta: "View Follows",
onPress: () => {
switchTab("profile")
navigate("favorites")
},
backgroundColor: "green100",
description: "Keep track of the artists you love",
})
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/app/Components/ArtworkGrids/ArtworkGridItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export interface ArtworkProps extends ArtworkActionTrackingProps {
/** allows for artwork to be added to recent searches */
updateRecentSearchesOnTap?: boolean
numColumns?: number
hideViewFollowsLink?: boolean
}

export const Artwork: React.FC<ArtworkProps> = ({
Expand Down Expand Up @@ -117,6 +118,7 @@ export const Artwork: React.FC<ArtworkProps> = ({
trackTap,
updateRecentSearchesOnTap = false,
numColumns = NUM_COLUMNS_MASONRY,
hideViewFollowsLink = false,
}) => {
const itemRef = useRef<any>()
const color = useColor()
Expand Down Expand Up @@ -445,6 +447,7 @@ export const Artwork: React.FC<ArtworkProps> = ({
artwork={artwork}
showSaveIcon={!hideSaveIcon}
showFollowIcon={!hideFollowIcon}
hideViewFollowsLink={hideViewFollowsLink}
contextModule={contextModule}
contextScreen={contextScreen}
contextScreenOwnerId={contextScreenOwnerId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ export interface Props extends ArtworkActionTrackingProps {
hideCuratorsPick?: boolean

hideRegisterBySignal?: boolean

hideViewFollowsLink?: boolean
}

interface PrivateProps {
Expand Down Expand Up @@ -185,6 +187,7 @@ const InfiniteScrollArtworksGrid: React.FC<Props & PrivateProps> = ({
hideIncreasedInterest,
hidePartner = false,
hideRegisterBySignal,
hideViewFollowsLink = false,
hideSaveIcon = false,
isLoading,
isMyCollection = false,
Expand Down Expand Up @@ -358,6 +361,7 @@ const InfiniteScrollArtworksGrid: React.FC<Props & PrivateProps> = ({
hideIncreasedInterestSignal={hideIncreasedInterest}
hideCuratorsPickSignal={hideCuratorsPick}
hideRegisterBySignal={hideRegisterBySignal}
hideViewFollowsLink={hideViewFollowsLink}
/>
)
// Setting a marginBottom on the artwork component didn’t work, so using a spacer view instead.
Expand Down
6 changes: 6 additions & 0 deletions src/app/Scenes/Artwork/Components/ArtworkItemCTAs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ interface ArtworkItemCTAsProps extends ArtworkActionTrackingProps {
showSaveIcon?: boolean
showFollowIcon?: boolean
dark?: boolean
hideViewFollowsLink?: boolean
}

export const ArtworkItemCTAs: React.FC<ArtworkItemCTAsProps> = ({
Expand All @@ -39,6 +40,10 @@ export const ArtworkItemCTAs: React.FC<ArtworkItemCTAsProps> = ({
*/
showFollowIcon = true,
dark = false,
/**
* do not hide view vollows link by default, hide on the Onboarding flow
*/
hideViewFollowsLink = false,
contextModule,
contextScreen,
contextScreenOwnerId,
Expand Down Expand Up @@ -98,6 +103,7 @@ export const ArtworkItemCTAs: React.FC<ArtworkItemCTAsProps> = ({
contextModule,
contextScreenOwnerType,
ownerType: Schema.OwnerEntityTypes.Artwork,
hideViewFollowsLink,
})

if (!enableNewSaveAndFollowOnArtworkCard) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const OnboardingMarketingCollection: React.FC<OnboardingMarketingCollectionProps
disableArtworksListPrompt
hideCuratorsPick={slug === "curators-picks-emerging"}
hideIncreasedInterest={slug === "curators-picks-emerging"}
hideViewFollowsLink
/>
<Flex p={2} backgroundColor="white">
<Button block onPress={() => navigate("OnboardingPostFollowLoadingScreen")} mb={1}>
Expand Down

0 comments on commit ebf9efd

Please sign in to comment.