Skip to content

Conversation

@kmonahan
Copy link
Collaborator

@kmonahan kmonahan commented Apr 8, 2024

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 SortableHeader component 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant