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

chore: Clean up artwork rail and extact sub components #10802

Conversation

olerichter00
Copy link
Contributor

@olerichter00 olerichter00 commented Sep 18, 2024

This PR resolves ONYX-1290

Description

This PR:

  • cleans up the artwork rail component and its sub-components,
  • creates the feature flag ARenableArtworkRailRedesignImageAspectRatio,
  • creates a new artwork rail image component that can be used for the new aspect ratio (LegacyArtworkRailCardImage vs ArtworkRailCardImage).

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@olerichter00 olerichter00 self-assigned this Sep 18, 2024
@olerichter00 olerichter00 marked this pull request as draft September 18, 2024 10:12
@@ -533,6 +533,7 @@ export default createFragmentContainer(Artwork, {
width: { type: "Int" }
) {
...CreateArtworkAlertModal_artwork
...ContextMenuArtwork_artwork @arguments(width: $width)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of passing the data we want to pass a fragment ref to ContextMenuArtwork.

@@ -127,29 +107,6 @@ export const ArtworkRailCard: React.FC<ArtworkRailCardProps> = ({
contextScreen,
} = restProps

const containerWidth = useMemo(() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not needed because we define the container width within the image component.

Comment on lines 176 to 180
{enableArtworkRailRedesignImageAspectRatio ? (
<ArtworkRailCardImage artwork={artwork} />
) : (
<LegacyArtworkRailCardImage artwork={artwork} urgencyTag={urgencyTag} />
)}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rendering the old or new image component depending on the feature flag enableArtworkRailRedesignImageAspectRatio

artwork: ArtworkRailCardImage_artwork$key
}

export const ArtworkRailCardImage: React.FC<ArtworkRailCardImageProps> = ({ ...restProps }) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the new image component where we can implement the new layout and aspect ratio.

@olerichter00 olerichter00 marked this pull request as ready for review September 18, 2024 10:39
@ArtsyOpenSource
Copy link
Contributor

ArtsyOpenSource commented Sep 18, 2024

Warnings
⚠️

An error occurred while validating your changelog, please make sure you provided a valid changelog.

Generated by 🚫 dangerJS against 7f6da84

dblandin
dblandin previously approved these changes Sep 18, 2024
Copy link
Member

@dblandin dblandin left a comment

Choose a reason for hiding this comment

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

Fantastic 🙌🏼

src/app/store/config/features.ts Outdated Show resolved Hide resolved
...CreateArtworkAlertModal_artwork
...ArtworkRailCardImage_artwork
...LegacyArtworkRailCardImage_artwork
...ContextMenuArtwork_artwork
Copy link
Member

Choose a reason for hiding this comment

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

praise: Awesome 💯

MrSltun
MrSltun previously approved these changes Sep 18, 2024
Copy link
Member

@MrSltun MrSltun left a comment

Choose a reason for hiding this comment

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

Looks great!! I just added one comment 🌟

{enableArtworkRailRedesignImageAspectRatio ? (
<ArtworkRailCardImage artwork={artwork} />
) : (
<LegacyArtworkRailCardImage artwork={artwork} urgencyTag={urgencyTag} />
Copy link
Member

Choose a reason for hiding this comment

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

This is emerald specific, can we remove the urgency tag since they're supposed to be removed after releasing the new auction signals?

Suggested change
<LegacyArtworkRailCardImage artwork={artwork} urgencyTag={urgencyTag} />
<LegacyArtworkRailCardImage artwork={artwork} urgencyTag={!displayAuctionSignal ? urgencyTag : null} />

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is great! So I can remove all the logic around urgency tags within the artwork rail completely?

Copy link
Member

Choose a reason for hiding this comment

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

since we released the auction signals, yeah feel free to remove the urgency tags logic :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

MounirDhahri
MounirDhahri previously approved these changes Sep 18, 2024
Copy link
Member

@MounirDhahri MounirDhahri left a comment

Choose a reason for hiding this comment

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

Great one

ARTWORK_RAIL_CARD_IMAGE_HEIGHT,
ARTWORK_RAIL_CARD_IMAGE_WIDTH,
} from "app/Components/ArtworkRail/LegacyArtworkRailCardImage"
import { OpaqueImageView } from "app/Components/OpaqueImageView2"
Copy link
Member

Choose a reason for hiding this comment

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

This is probably not in the scope of this PR. Maybe in a future PR we can use Image from palette here

@olerichter00 olerichter00 dismissed stale reviews from MounirDhahri and MrSltun via f1ec362 September 18, 2024 13:20
@olerichter00 olerichter00 added the Squash On Green A label to indicate that Peril should squash-merge this PR when all statuses are green label Sep 18, 2024
@artsy-peril artsy-peril bot merged commit 1aec4b6 into main Sep 18, 2024
7 checks passed
@artsy-peril artsy-peril bot deleted the olerichter00/ONYX-1290/clean-up-artwork-rail-and-extact-sub-components branch September 18, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Jira Synced Squash On Green A label to indicate that Peril should squash-merge this PR when all statuses are green
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants