Skip to content

Conversation

StevenDufresne
Copy link
Collaborator

@StevenDufresne StevenDufresne commented Jul 15, 2021

This PR adds the ability to sort patterns based on 2 dimensions:

  • Newest
  • Favorited

In the future, we hope to add support for Featured categories.

Fixes #161

Needs Resolution

Currently, block patterns don't start with the meta key: wporg-pattern-favorites set. This means that when we run the sorting query it will only return the patterns that have favorites. That may not be the experience we are looking for. In order to correct it, we'll need to set a default value. Should we register_post_meta and set the default value to 0?

Example:

Screenshots

Desktop Mobile

How to test the changes in this Pull Request:

  1. Visit /
  2. Use the dropdown
  3. Expect that the results match

@StevenDufresne StevenDufresne requested a review from ryelle July 15, 2021 02:19
}

return (
<div className="pattern-select-control">
Copy link
Contributor

Choose a reason for hiding this comment

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

This should use the same name as the component/folder, so either the class should be pattern-order-select or the component should be pattern-select-control (but that sounds like you're selecting a pattern).

@ryelle ryelle force-pushed the add/pattern-ordering branch from 75d939e to 8ff8e0e Compare July 16, 2021 16:06
StevenDufresne and others added 9 commits July 16, 2021 12:28
- Since it can contain more than a menu, use "navigation"
- Use primary and secondary in place of left/right - it's not left/right on smaller screens or in RTL
- Move the menu & select styles into their CSS files
- Use primary/secondary div wrappers to make the layout CSS less dependent on specific content
@ryelle ryelle force-pushed the add/pattern-ordering branch from 8ff8e0e to 416cadb Compare July 16, 2021 17:30
@ryelle ryelle added the [Component] Theme The frontend of the pattern directory, pattern lists UI label Jul 16, 2021
@ryelle ryelle self-requested a review July 19, 2021 16:42
@ryelle ryelle merged commit 83777b9 into trunk Jul 19, 2021
@ryelle ryelle deleted the add/pattern-ordering branch July 19, 2021 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Component] Theme The frontend of the pattern directory, pattern lists UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ordering support when browsing patterns
2 participants