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 #6423

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

anandaroop
Copy link
Member

@anandaroop anandaroop commented Feb 11, 2025

Note

Required by artsy/eigen#11528

https://artsyproduct.atlassian.net/browse/ONYX-1484

Adds an optional icon to the NavigationPill section type, which is used by the new QuickLinks section:

{
  homeView {
    section(id: "home-view-section-quick-links") {
      internalID
      __typename
      
      ... on HomeViewSectionNavigationPills {
        navigationPills {
          href
          ownerType
          title
          icon            # 👈🏽 👈🏽 new
        }
      }
    }
  }
}
{
  "data": {
    "homeView": {
      "section": {
        "internalID": "home-view-section-quick-links",
        "__typename": "HomeViewSectionNavigationPills",
        "navigationPills": [
          {
            "href": "/favorites",
            "ownerType": "follows",
            "title": "Follows",
            "icon": "FollowArtistIcon" // 👈🏽 👈🏽 icon name included in response, if it is defined
          },
          {
            "href": "/auctions",
            "ownerType": "auctions",
            "title": "Auctions",
            "icon": "AuctionIcon"
          },
          {
            "href": "/favorites/saves",
            "ownerType": "saves",
            "title": "Saves",
            "icon": "HeartIcon"
          },
          {
            "href": "/collect?price_range=%2A-1000",
            "ownerType": "collect",
            "title": "Art under $1000",
            "icon": null               // 👈🏽 👈🏽 else it is null
          },
          {
            "href": "/price-database",
            "ownerType": "priceDatabase",
            "title": "Price Database",
            "icon": null
          },
          {
            "href": "/news",
            "ownerType": "articles",
            "title": "Editorial",
            "icon": null
          }
        ]
      }
    }
  }

Comment on lines +39 to +42
icon: {
type: GraphQLString,
description: "Icon file name",
},
Copy link
Member Author

@anandaroop anandaroop Feb 11, 2025

Choose a reason for hiding this comment

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

I debated typing this as an enum. But since the source of truth for which icons is supported is over in Eigen, there didn't seem to be any benefit in doing so, just an extra chore to keep the two repos synchronized.

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! thanks

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.

Thanks!

@anandaroop anandaroop merged commit f54e31c into main Feb 11, 2025
4 checks passed
@anandaroop anandaroop deleted the anandaroop/ONYX-1484-pill-icons branch February 11, 2025 14:37
@artsy-peril artsy-peril bot mentioned this pull request Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants