Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update contact gallery for private artwork to match spec (#10174)
- Loading branch information
1 parent
500e262
commit 0ce3886
Showing
3 changed files
with
64 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { EntityHeader, EnvelopeIcon, Flex } from "@artsy/palette-mobile" | ||
import { ShortContactGallery_artwork$key } from "__generated__/ShortContactGallery_artwork.graphql" | ||
import { navigateToPartner } from "app/system/navigation/navigate" | ||
import { TouchableWithoutFeedback } from "react-native" | ||
import { graphql, useFragment } from "react-relay" | ||
import { InquiryButtonsFragmentContainer } from "./CommercialButtons/InquiryButtons" | ||
|
||
interface ShortContactGalleryProps { | ||
artwork: ShortContactGallery_artwork$key | ||
partnerHref?: string | ||
partnerName?: string | null | ||
locationNames?: string | null | ||
showPartnerType?: boolean | ||
} | ||
|
||
export const ShortContactGallery: React.FC<ShortContactGalleryProps> = (props) => { | ||
const artworkData = useFragment(artworkFragment, props.artwork) | ||
|
||
return ( | ||
<Flex flexDirection="row" flexWrap="wrap" justifyContent="space-between" alignItems="center"> | ||
<TouchableWithoutFeedback | ||
onPress={() => { | ||
if (props.partnerHref) { | ||
navigateToPartner(props.partnerHref) | ||
} | ||
}} | ||
> | ||
<EntityHeader | ||
name={props.partnerName ?? ""} | ||
meta={props.locationNames ?? ""} | ||
style={{ flex: 1 }} | ||
/> | ||
</TouchableWithoutFeedback> | ||
<InquiryButtonsFragmentContainer | ||
artwork={artworkData} | ||
variant="outline" | ||
size="small" | ||
icon={<EnvelopeIcon fill="black100" width="16px" height="16px" />} | ||
/> | ||
</Flex> | ||
) | ||
} | ||
|
||
const artworkFragment = graphql` | ||
fragment ShortContactGallery_artwork on Artwork { | ||
...InquiryButtons_artwork | ||
} | ||
` |