-
Notifications
You must be signed in to change notification settings - Fork 584
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
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
e4a978c
to
9b76941
Compare
const SUPPORTED_ICONS: Record<string, ComponentType> = { | ||
FollowArtistIcon, | ||
AuctionIcon, | ||
HeartIcon, | ||
} |
There was a problem hiding this comment.
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.
src/app/Scenes/HomeView/Sections/HomeViewSectionNavigationPills.tsx
Outdated
Show resolved
Hide resolved
src/app/Scenes/HomeView/Sections/HomeViewSectionNavigationPills.tsx
Outdated
Show resolved
Hide resolved
9b76941
to
cdc4852
Compare
src/app/Scenes/HomeView/Sections/HomeViewSectionNavigationPills.tsx
Outdated
Show resolved
Hide resolved
src/app/Scenes/HomeView/Sections/HomeViewSectionNavigationPills.tsx
Outdated
Show resolved
Hide resolved
e6fcc1c
e6fcc1c
to
d5642b5
Compare
There was a problem hiding this 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)
ArtworkIcon, | ||
AuctionIcon as GavelIcon, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -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]} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great ⭐
d5642b5
to
945666e
Compare
Rebasing and merging now… |
This PR resolves ONYX-1464
Description
Consumes the new
icon
field of theNavigationPill
MP type in order to render icons in the Quick Links section of the home view.Unsupported or missing icons are simply not rendered.
PR Checklist
To the reviewers 👀
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.