8000 feat(button): add controlled component functionality to SplitButton by eirikhaugstulen · Pull Request #1685 · dhis2/ui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(button): add controlled component functionality to SplitButton #1685

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

Merged
merged 5 commits into from
May 19, 2025

Conversation

eirikhaugstulen
Copy link
Contributor
@eirikhaugstulen eirikhaugstulen commented May 12, 2025

Summary:

  • Added functionality for controlling the open-state through passing in open and onToggle
  • Added storybook example with advanced functionality (FlyoutMenu & Modal)

@dhis2-bot
Copy link
Contributor
dhis2-bot commented May 12, 2025

🚀 Deployed on https://pr-1685--dhis2-ui.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify May 12, 2025 17:47 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify May 12, 2025 19:05 Inactive
@dhis2-bot dhis2-bot temporarily deployed to netlify May 12, 2025 19:17 Inactive
@eirikhaugstulen eirikhaugstulen marked this pull request as ready for review May 13, 2025 07:36
@eirikhaugstulen eirikhaugstulen requested a review from a team as a code owner May 13, 2025 07:36
@eirikhaugstulen eirikhaugstulen requested a review from Birkbjo May 13, 2025 07:36
Copy link
Member
@Birkbjo Birkbjo left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor
@KaiVandivier KaiVandivier 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!

I have a readability tip: since typeof this.props.open === 'boolean' is used a lot, you could maybe make a method to reuse that:

isControlled = () => typeof this.props.open === 'boolean'

that you could then use:

const open = this.isControlled() ? this.props.open : this.state.open

Copy link

@dhis2-bot dhis2-bot temporarily deployed to netlify May 19, 2025 10:19 Inactive
@eirikhaugstulen eirikhaugstulen enabled auto-merge (squash) May 19, 2025 10:21
@eirikhaugstulen eirikhaugstulen merged commit f027b0b into master May 19, 2025
17 checks passed
@eirikhaugstulen eirikhaugstulen deleted the eh/feat/allow-split-button-to-be-controlled branch May 19, 2025 10:21
dhis2-bot added a commit that referenced this pull request May 19, 2025
# [10.7.0](v10.6.0...v10.7.0) (2025-05-19)

### Features

* **button:** add controlled component functionality to SplitButton ([#1685](#1685)) ([f027b0b](f027b0b))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 10.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0