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

Small refactoring for SegmentedControl component. #19291

Merged
merged 1 commit into from May 13, 2024

Conversation

linuspahl
Copy link
Contributor

@linuspahl linuspahl commented May 8, 2024

Please note: This PR is required for https://github.com/Graylog2/graylog-plugin-enterprise/pull/7240

Description

Motivation and Context

This PR contains a small refactoring for the SegmentedControl component. We are:

  • renaming the handleChange prop to onChange to follow our naming convention and we are simplifying the related type.
  • implementing a generic type for the value options, to avoid the need to use as when providing the onChange function
  • removing the Array<string> for the data prop. It is being supported by the mantine SegmentedControl component, but having a look at the Select component, future maintenance will be easier if we allow only one format for these options.

/nocl

Copy link
Contributor

@grotlue grotlue left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adjusting it :)

@grotlue grotlue merged commit 7a436b9 into master May 13, 2024
9 checks passed
@grotlue grotlue deleted the refactor/segmented-control branch May 13, 2024 10:53
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.

None yet

2 participants