Skip to content

Commit

Permalink
Merge pull request #10500 from artsy/oxaudo/notte
Browse files Browse the repository at this point in the history
chore: Remove sub-copy from Artwork Saved tooltip for auction lots
  • Loading branch information
oxaudo authored Jul 18, 2024
2 parents 0716453 + 25be773 commit 27c37c8
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ const preselectedArtworkLists = {
const artworkEntity: ArtworkEntity = {
id: "artwork-id",
internalID: "artwork-internal-id",
isInAuction: false,
title: "Artwork Title",
year: "2023",
artistNames: "Banksy",
Expand Down
1 change: 1 addition & 0 deletions src/app/Components/ArtworkLists/ArtworkListsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const ArtworkListsProvider: FC<ArtworkListsProviderProps> = ({
if (result.action === ResultAction.SavedToDefaultArtworkList) {
toast.savedToDefaultArtworkList({
onToastPress: () => openSelectArtworkListsForArtworkView(result.artwork as ArtworkEntity),
isInAuction: !!result.artwork.isInAuction,
})
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ describe("ArtworkInfo", () => {
})

const artworkEntity: ArtworkEntity = {
artistNames: "Banksy",
id: "artwork-id",
imageURL: null,
internalID: "artwork-internal-id",
artistNames: "Banksy",
isInAuction: false,
title: "Artwork Title",
year: "2023",
imageURL: null,
}
1 change: 1 addition & 0 deletions src/app/Components/ArtworkLists/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export interface ArtworkEntity {
year: string | null | undefined
artistNames: string | null | undefined
imageURL: string | null | undefined
isInAuction: boolean | null | undefined
}

export type SaveResult = {
Expand Down
10 changes: 6 additions & 4 deletions src/app/Components/ArtworkLists/useArtworkListsToast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface Options {

type SavedToDefaultArtworkListOptions = {
onToastPress: () => void
isInAuction: boolean
}

type MultipleArtworkListsOptions = Options & {
Expand All @@ -33,15 +34,16 @@ export const useArtworkListToast = (bottomPadding?: number | null) => {
})
}
const savedToDefaultArtworkList = (options: SavedToDefaultArtworkListOptions) => {
const { onToastPress } = options
const { onToastPress, isInAuction } = options

showToast("Artwork saved", {
cta: "Add to a List",
onPress: onToastPress,
backgroundColor: "green100",
description: isPartnerOfferEnabled
? "Saving an artwork signals interest to galleries."
: null,
description:
isPartnerOfferEnabled && !isInAuction
? "Saving an artwork signals interest to galleries."
: null,
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const useSaveArtworkToArtworkLists = (options: Options) => {
year: artwork.date,
artistNames: artwork.artistNames,
imageURL: artwork.preview?.url ?? null,
isInAuction: !!artwork.isInAuction,
}
let isSaved = artwork.isSaved

Expand Down Expand Up @@ -105,6 +106,7 @@ const ArtworkFragment = graphql`
fragment useSaveArtworkToArtworkLists_artwork on Artwork {
id
internalID
isInAuction
isSaved
slug
title
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,11 @@ describe("CreateNewArtworkListView", () => {
})

const artworkEntity: ArtworkEntity = {
artistNames: "Banksy",
id: "artwork-id",
imageURL: null,
internalID: "artwork-internal-id",
isInAuction: false,
title: "Artwork Title",
year: "2023",
artistNames: "Banksy",
imageURL: null,
}

0 comments on commit 27c37c8

Please sign in to comment.