Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ports the styles and icons for a sortable table from forumone/gesso#794 and adds a story with example usage, based on https://forumone.github.io/gesso/?path=/story/components-table--sortable. Also creates a
SortableHeadercomponent and pulls in a couple utilities from Gesso Drupal that we didn't have here yet.The main difference between this and the Drupal implementation is that the React version assumes you are sorting data and then rendering a table, rather than assuming you have a table HTML as your starting point. Thus the table output and sorting logic are in the story (and would be in the component in a real project) rather than an external JS file. Unless I needed to do something radically different on a project, I'd probably copy/paste the story example and then update the typings to match whatever data structure I was using.
We discussed this approach generally at the last Gesso for React check-in, but now that you see it, thoughts? Anything that feels like it is generic/reusable enough to warrant pulling out of the story into its own reusable component or utility function?