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

feat(home view): add icons to navigation pills #11528

Merged
merged 3 commits into from
Feb 20, 2025

Conversation

anandaroop
Copy link
Member

@anandaroop anandaroop commented Feb 11, 2025

This PR resolves ONYX-1464

Description

Consumes the new icon field of the NavigationPill MP type in order to render icons in the Quick Links section of the home view.

Unsupported or missing icons are simply not rendered.

iOS Android
iOS iOS

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

  • Display icons with home view navigation pills

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.

@anandaroop

This comment was marked as outdated.

@anandaroop anandaroop force-pushed the anandaroop/ONYX-1484-quick-links-icons branch from e4a978c to 9b76941 Compare February 11, 2025 04:20
Comment on lines 190 to 194
const SUPPORTED_ICONS: Record<string, ComponentType> = {
FollowArtistIcon,
AuctionIcon,
HeartIcon,
}
Copy link
Member Author

Choose a reason for hiding this comment

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

We may want to launch with a larger set of icons supported right at the outset.

MounirDhahri

This comment was marked as outdated.

@anandaroop anandaroop force-pushed the anandaroop/ONYX-1484-quick-links-icons branch from 9b76941 to cdc4852 Compare February 11, 2025 20:14
@anandaroop anandaroop dismissed stale reviews from dariakoko and MounirDhahri via e6fcc1c February 19, 2025 22:14
@anandaroop anandaroop force-pushed the anandaroop/ONYX-1484-quick-links-icons branch 2 times, most recently from e6fcc1c to d5642b5 Compare February 19, 2025 22:45
Copy link
Member Author

@anandaroop anandaroop left a comment

Choose a reason for hiding this comment

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

To recap:

Icon naming:

  • We decided that the simplest way to anticipate the icon refactor is to start using the standard icon naming from artsy/icons
  • The work to make palette-mobile conform to that naming is ticketed in ONYX-1550
    • This PR adopts that naming convention already by renaming a couple of icons on import (see comment below); so there is no big rush on ONYX-1550
  • I've decided to keep things simple here by not trying to add a layer of abstraction for icon intent, or trying to exhaustively anticipate future name changes for icons. That all seems a little YAGNI to me. If anyone strongly disagrees, we can revisit!

Pill content:

  • Due to some miscommunication, the initial round of MP work on pills returns incorrect data
  • That work will be corrected in MP next ONYX-1554
    • (I hard-coded the corrected data for the sake of the screenshots above, so that's what everyone can expect to see soon)

Comment on lines +3 to +4
ArtworkIcon,
AuctionIcon as GavelIcon,
Copy link
Member Author

@anandaroop anandaroop Feb 19, 2025

Choose a reason for hiding this comment

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

Only a couple of the icons we need for Quick Links are going to be affected by the rename, so here and L9 below I simply rename them to what we expect them to be in the future.

The full renaming work is ticketed in ONYX-1550 — an excerpt of the audit, relevant to Quick Links, is below:

Screenshot 2025-02-19 at 5 46 33 PM

@@ -57,6 +72,7 @@ export const HomeViewSectionNavigationPills: React.FC<HomeViewSectionNavigationP
accessibilityRole="link"
testID={`pill-${pill.title}`}
variant="link"
Icon={SUPPORTED_ICONS[pill.icon as string]}
Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks to the realization that Pill already supports an Icon prop, the implementation here is greatly simplified. Basically just this line and the SUPPORTED_ICONS mapping below on L191.

@anandaroop anandaroop marked this pull request as ready for review February 19, 2025 22:55
@ArtsyOpenSource
Copy link
Contributor

ArtsyOpenSource commented Feb 19, 2025

This PR contains the following changes:

  • Cross-platform user-facing changes (Display icons with home view navigation pills - anandaroop)

Generated by 🚫 dangerJS against 945666e

dariakoko
dariakoko previously approved these changes Feb 20, 2025
Copy link
Contributor

@dariakoko dariakoko 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 ⭐

@anandaroop anandaroop force-pushed the anandaroop/ONYX-1484-quick-links-icons branch from d5642b5 to 945666e Compare February 20, 2025 18:17
@anandaroop
Copy link
Member Author

Rebasing and merging now…

@anandaroop anandaroop added the Squash On Green A label to indicate that Peril should squash-merge this PR when all statuses are green label Feb 20, 2025
@artsy-peril artsy-peril bot merged commit 6d7244f into main Feb 20, 2025
7 checks passed
@artsy-peril artsy-peril bot deleted the anandaroop/ONYX-1484-quick-links-icons branch February 20, 2025 18:52
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