citizennet / purescript-ocelot

An opinionated component library for Halogen apps
https://citizennet.github.io/purescript-ocelot/
Apache License 2.0
102 stars 15 forks source link

FBCM-5076 Add pill buttons #244

Closed davezuch closed 2 years ago

davezuch commented 2 years ago

What does this pull request do?

We're adding a variant of buttons to be used for selected filters in a list view.

Where should the reviewer start?

Commit-by-commit.

How should this be manually tested?

Optional, but you can run make ui-guide locally then load http://localhost:1234/#buttons.

arthurxavierx commented 2 years ago

I'm not sure I understand from this PR and from the examples how the pill buttons should be used. Like, how can I, as a developer, write code that reacts to, say, clicks on a pill button?

davezuch commented 2 years ago

Like, how can I, as a developer, write code that reacts to, say, clicks on a pill button?

For the button you just provide a Halogen action to the props. Although for our use case, where we're just using them to display selected filters, I think we should use the pill anchors instead, with a link that removes the filter from the query params.

arthurxavierx commented 2 years ago

For the button you just provide a Halogen action to the props.

Ah that makes sense, thanks!