Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ONYX-1375): fix SellWithArtsyRecentlySold Rail layout #11015

Merged
merged 3 commits into from
Oct 25, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import { ArtworkRailProps } from "app/Components/ArtworkRail/ArtworkRail"
import {
ARTWORK_RAIL_CARD_MINIMUM_WIDTH,
ARTWORK_RAIL_TEXT_CONTAINER_HEIGHT,
ArtworkRailCard,
} from "app/Components/ArtworkRail/ArtworkRailCard"
import { PrefetchFlashList } from "app/Components/PrefetchFlashList"
Expand Down Expand Up @@ -103,7 +104,9 @@ const RecentlySoldArtworksRail: React.FC<RecentlySoldArtworksRailProps> = ({
onPress={() => {
onPress?.(item, index)
}}
metaContainerStyles={{ height: 100 }}
metaContainerStyles={{
height: ARTWORK_RAIL_TEXT_CONTAINER_HEIGHT + 10,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Where does this + 10 come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think PixelRatio.getFontScale() cannot recognize when the Estimate goes into two lines, so we need to add the extra line height manually (10 is enough even tho the line height of the text is 20)
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we achieve the same by making the overflow visible (e.g. overflow: visible)? I would prefer this solution instead of adding padding for this special case. Or we could make the height of the meta text container flexible which would be the most natural way for me to solve the issue (imagine the text needs to have 3 or 4 lines which could theoretically happen). 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thought here - You can also set the metaCardHeight to 110 if 100 is not enough

}}
showPartnerName={showPartnerName}
SalePriceComponent={
<RecentlySoldCardSection
Expand Down Expand Up @@ -154,12 +157,12 @@ const RecentlySoldCardSection: React.FC<RecentlySoldCardSectionProps> = ({
}) => {
return (
<Flex>
<Flex flexDirection="row" justifyContent="space-between" mt={1}>
<Text variant="lg-display" numberOfLines={1}>
<Flex flexDirection="row" justifyContent="space-between">
<Text variant="md" numberOfLines={1}>
{priceRealizedDisplay}
</Text>
{!!performanceDisplay && (
<Text variant="lg-display" color="green" numberOfLines={1}>
<Text variant="md" color="green" numberOfLines={1}>
{`+${performanceDisplay}`}
</Text>
)}
Expand Down