Skip to content

Commit

Permalink
fix: adjust SellWithArtsyRecentlySold rail card height (#11188)
Browse files Browse the repository at this point in the history
  • Loading branch information
dariakoko authored Nov 25, 2024
1 parent 0e9cb52 commit 0065ee9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
7 changes: 4 additions & 3 deletions src/app/Components/ArtworkRail/ArtworkRailCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const ArtworkRailCard: React.FC<ArtworkRailCardProps> = ({
hideCuratorsPickSignal = false,
lotLabel,
showPartnerName = false,
metaContainerStyles,
containerHeight,
onPress,
SalePriceComponent,
showSaveIcon = false,
Expand Down Expand Up @@ -108,7 +108,9 @@ export const ArtworkRailCard: React.FC<ArtworkRailCardProps> = ({
testID={testID}
>
<Flex
height={ARTWORK_RAIL_CARD_IMAGE_HEIGHT + artworkRailCardMetaDataHeight}
height={
containerHeight ?? ARTWORK_RAIL_CARD_IMAGE_HEIGHT + artworkRailCardMetaDataHeight
}
justifyContent="flex-start"
>
<ArtworkRailCardImage artwork={artwork} />
Expand All @@ -127,7 +129,6 @@ export const ArtworkRailCard: React.FC<ArtworkRailCardProps> = ({
hideCuratorsPickSignal={hideCuratorsPickSignal}
hideIncreasedInterestSignal={hideIncreasedInterestSignal}
lotLabel={lotLabel}
metaContainerStyles={metaContainerStyles}
SalePriceComponent={SalePriceComponent}
showPartnerName={showPartnerName}
showSaveIcon={showSaveIcon}
Expand Down
11 changes: 2 additions & 9 deletions src/app/Components/ArtworkRail/ArtworkRailCardMeta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface ArtworkRailCardCommonProps extends ArtworkActionTrackingProps {
hideIncreasedInterestSignal?: boolean
hideCuratorsPickSignal?: boolean
lotLabel?: string | null
metaContainerStyles?: {}
containerHeight?: number
showSaveIcon?: boolean
showPartnerName?: boolean
/**
Expand Down Expand Up @@ -54,7 +54,6 @@ export const ArtworkRailCardMeta: React.FC<ArtworkRailCardMetaProps> = ({
hideCuratorsPickSignal = false,
hideIncreasedInterestSignal = false,
lotLabel,
metaContainerStyles,
SalePriceComponent,
showPartnerName = false,
showSaveIcon = false,
Expand Down Expand Up @@ -128,13 +127,7 @@ export const ArtworkRailCardMeta: React.FC<ArtworkRailCardMetaProps> = ({
!sale?.isAuction && !displayLimitedTimeOfferSignal && !!collectorSignals

return (
<Flex
style={{
...metaContainerStyles,
}}
flexDirection="row"
justifyContent="space-between"
>
<Flex flexDirection="row" justifyContent="space-between">
<Flex flex={1}>
{!!lotLabel && (
<Text lineHeight="20px" color={secondaryColor} numberOfLines={1}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ARTWORK_RAIL_CARD_MINIMUM_WIDTH,
ArtworkRailCard,
} from "app/Components/ArtworkRail/ArtworkRailCard"
import { ARTWORK_RAIL_CARD_IMAGE_HEIGHT } from "app/Components/ArtworkRail/ArtworkRailCardImage"
import { PrefetchFlashList } from "app/Components/PrefetchFlashList"
import { navigate } from "app/system/navigation/navigate"
import { extractNodes } from "app/utils/extractNodes"
Expand Down Expand Up @@ -104,9 +105,8 @@ const RecentlySoldArtworksRail: React.FC<RecentlySoldArtworksRailProps> = ({
onPress={() => {
onPress?.(item, index)
}}
metaContainerStyles={{
height: PixelRatio.getFontScale() * 100,
}}
// adding 20 to make sure the estimated section is not cut off when displayed in two lines
containerHeight={ARTWORK_RAIL_CARD_IMAGE_HEIGHT + PixelRatio.getFontScale() * 100 + 20}
showPartnerName={showPartnerName}
SalePriceComponent={
<RecentlySoldCardSection
Expand Down

0 comments on commit 0065ee9

Please sign in to comment.