Skip to content

Commit

Permalink
feat: add enableSaveButtonForLists prop
Browse files Browse the repository at this point in the history
  • Loading branch information
dimatretyak committed Feb 28, 2023
1 parent eeaf33b commit 97baa1f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Components/Artwork/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ interface DetailsProps {
showHighDemandIcon?: boolean
showHoverDetails?: boolean
showSaveButton?: boolean
enableSaveButtonForLists?: boolean
renderSaveButton?: (artworkId: string) => React.ReactNode
}

Expand Down Expand Up @@ -222,6 +223,7 @@ export const Details: React.FC<DetailsProps> = ({
showHighDemandIcon = false,
showHoverDetails = true,
showSaveButton,
enableSaveButtonForLists,
renderSaveButton,
...rest
}) => {
Expand All @@ -248,7 +250,7 @@ export const Details: React.FC<DetailsProps> = ({
return renderSaveButton(rest.artwork.internalID)
}

if (isArtworksListEnabled) {
if (isArtworksListEnabled && enableSaveButtonForLists) {
return (
<SaveArtworkToListsButtonFragmentContainer
contextModule={contextModule!}
Expand Down
1 change: 1 addition & 0 deletions src/Components/Artwork/GridItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export const ArtworkGridItem: React.FC<ArtworkGridItemProps> = ({
showHoverDetails={showHoverDetails}
disableRouterLinking={disableRouterLinking}
to={to}
enableSaveButtonForLists
renderSaveButton={renderSaveButton}
/>
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/Components/Artwork/Metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface MetadataProps
showHoverDetails?: boolean
showSaveButton?: boolean
to?: string | null
enableSaveButtonForLists?: boolean
renderSaveButton?: (artworkId: string) => React.ReactNode
}

Expand All @@ -39,6 +40,7 @@ export const Metadata: React.FC<MetadataProps> = ({
showHighDemandIcon = false,
showHoverDetails,
showSaveButton,
enableSaveButtonForLists,
renderSaveButton,
...rest
}) => {
Expand All @@ -60,6 +62,7 @@ export const Metadata: React.FC<MetadataProps> = ({
showHoverDetails={showHoverDetails}
showSaveButton={showSaveButton}
contextModule={contextModule}
enableSaveButtonForLists={enableSaveButtonForLists}
renderSaveButton={renderSaveButton}
/>
</LinkContainer>
Expand Down

0 comments on commit 97baa1f

Please sign in to comment.