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

Update style of filter toggle buttons #6106

Merged
merged 1 commit into from
Jan 17, 2024
Merged

Conversation

robertknight
Copy link
Member

Update style of filter toggle buttons to align them with the current mocks.
Also fix accessibility of the pressed state by using the pressed button prop
to indicate whether the toggle is active.

Part of #6006.


Filter active:

filter-toggle-active

This should use a minus rather than a plus icon, but we don't have one in the pattern library yet. I will add that and update this.

Filter inactive:

filter-toggle-inactive

Copy link

codecov bot commented Jan 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (915a6e0) 99.45% compared to head (2c26b4f) 99.45%.

❗ Current head 2c26b4f differs from pull request most recent head 9820efb. Consider uploading reports for the commit 9820efb to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6106   +/-   ##
=======================================
  Coverage   99.45%   99.45%           
=======================================
  Files         265      265           
  Lines       10207    10210    +3     
  Branches     2465     2467    +2     
=======================================
+ Hits        10151    10154    +3     
  Misses         56       56           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@acelaya acelaya left a comment

Choose a reason for hiding this comment

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

Just added a small suggestion regarding aliasing props, but LGTM.

Comment on lines 43 to 49
icon,
description,
active,
setActive,
testId,
}: FilterToggleProps) {
const IconComponent = icon;
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps you can alias it inline when unpacking the props. If I remember correctly, we use that pattern frequently in frontend-shared.

Suggested change
icon,
description,
active,
setActive,
testId,
}: FilterToggleProps) {
const IconComponent = icon;
icon: IconComponent,
description,
active,
setActive,
testId,
}: FilterToggleProps) {

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. Will do.

Update style of filter toggle buttons to align them with the current mocks.
Also fix accessibility of the pressed state by using the `pressed` button prop
to indicate whether the toggle is active.

Part of #6006.
@robertknight robertknight merged commit b06d0d1 into main Jan 17, 2024
2 checks passed
@robertknight robertknight deleted the filter-pill-buttons branch January 17, 2024 15:52
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.

2 participants